diff --git a/README.md b/README.md index 77ae50e..3fe80b9 100644 --- a/README.md +++ b/README.md @@ -62,4 +62,4 @@ $ `cd translator && ./run/run-java --file=../test/test-dir/entities.yml --out=.. Updating the version in all files: -$ `./util/update-vesion 1.0.1 1.1.0` +$ `./util/update-version 1.0.1 1.1.0` diff --git a/translator/src/genKotlin.kt b/translator/src/genKotlin.kt index 3ec4fe1..b5f8a23 100644 --- a/translator/src/genKotlin.kt +++ b/translator/src/genKotlin.kt @@ -94,10 +94,18 @@ fun genKotlinFieldDefault(type: String): String { if (type == "Bool") { return "false" } + // `Double` -> `0` + if (type == "Double") { + return "0" + } // `Int` -> `0` if (type == "Int") { return "0" } + // `Long` -> `0` + if (type == "Long") { + return "0" + } // `String` -> `""` if (type == "String") { return "\"\"" @@ -148,6 +156,14 @@ fun genKotlinFieldType(type: String): String { if (type == "Bool") { return "Boolean" } + // `Double` -> `Double` + if (type == "Double") { + return "Double" + } + // `Long` -> `Long` + if (type == "Long") { + return "Long" + } // `[Type]` -> `Array` if ( type.startsWith("[") &&