KT-1895 Make it possible to pass 1.0 as Float without explicit casting

#KT-1895 fixed
This commit is contained in:
Evgeny Gerashchenko
2013-01-27 01:57:02 +04:00
parent 0b1fe9c611
commit 18b5495a8c
2 changed files with 25 additions and 8 deletions
@@ -132,7 +132,7 @@ public class CompileTimeConstantResolver {
}
else if (JetTypeChecker.INSTANCE.isSubtypeOf(builtIns.getFloatType(), expectedType)) {
try {
return new DoubleValue(Float.parseFloat(text));
return new FloatValue(Float.parseFloat(text));
}
catch (NumberFormatException e) {
return OUT_OF_RANGE;