Stdlib generators: change constants for Long: ZERO, ONE, -ONE.

This commit is contained in:
Ilya Gorbunov
2015-07-06 19:22:33 +03:00
parent 10c376975a
commit 0a320a13e5
3 changed files with 8 additions and 7 deletions
@@ -206,18 +206,19 @@ class GenericFunction(val signature: String, val keyword: String = "fun") : Comp
"ZERO" -> when (primitive) {
PrimitiveType.Double -> "0.0"
PrimitiveType.Float -> "0.0f"
PrimitiveType.Long -> "0L"
else -> "0"
}
"ONE" -> when (primitive) {
PrimitiveType.Double -> "1.0"
PrimitiveType.Float -> "1.0f"
PrimitiveType.Long -> "1.toLong()"
PrimitiveType.Long -> "1L"
else -> "1"
}
"-ONE" -> when (primitive) {
PrimitiveType.Double -> "-1.0"
PrimitiveType.Float -> "-1.0f"
PrimitiveType.Long -> "-1.toLong()"
PrimitiveType.Long -> "-1L"
else -> "-1"
}
"TCollection" -> {