Letter-ending number literals removed (10L, 1.0d, 1.0f)

This commit is contained in:
Andrey Breslav
2011-03-16 15:22:49 +03:00
parent 495f1ea3b9
commit 6fb8ed823c
8 changed files with 574 additions and 592 deletions
@@ -54,17 +54,14 @@ public class JetTypeCheckerTest extends LightDaemonAnalyzerTestCase {
assertType("0b1", library.getIntType());
assertType("0B1", library.getIntType());
assertType("1l", library.getLongType());
assertType("1L", library.getLongType());
assertType("1.lng", library.getLongType());
assertType("1.0", library.getDoubleType());
assertType("1.0d", library.getDoubleType());
assertType("1.0D", library.getDoubleType());
assertType("1.0.dbl", library.getDoubleType());
assertType("0x1.fffffffffffffp1023", library.getDoubleType());
assertType("1.0f", library.getFloatType());
assertType("1.0F", library.getFloatType());
assertType("0x1.fffffffffffffp1023f", library.getFloatType());
assertType("1.0.flt", library.getFloatType());
assertType("0x1.fffffffffffffp1023.flt", library.getFloatType());
assertType("true", library.getBooleanType());
assertType("false", library.getBooleanType());
@@ -341,62 +338,62 @@ public class JetTypeCheckerTest extends LightDaemonAnalyzerTestCase {
public void testOverloads() throws Exception {
assertType("new Functions<String>().f()", "Unit");
assertType("new Functions<String>().f(1)", "Int");
assertType("new Functions<String>().f(1d)", (String) null);
assertType("new Functions<String>().f(1.0)", (String) null);
assertType("new Functions<Double>().f((1, 1))", "Double");
assertType("new Functions<Double>().f(1d)", "Any");
assertType("new Functions<Double>().f(1.0)", "Any");
assertType("new Functions<Byte>().f<String>(\"\")", "Byte");
assertType("new Functions<Byte>().f<String>(1)", (String) null);
assertType("f()", "Unit");
assertType("f(1)", "Int");
assertType("f(1f, 1)", "Float");
assertType("f<String>(1f)", "String");
assertType("f(1.flt, 1)", "Float");
assertType("f<String>(1.flt)", "String");
assertType("f(1.0)", (String) null);
}
public void testPlus() throws Exception {
assertType("1d.plus(1d)", "Double");
assertType("1d.plus(1f)", "Double");
assertType("1d.plus(1L)", "Double");
assertType("1d.plus(1)", "Double");
assertType("1.0.plus(1.dbl)", "Double");
assertType("1.0.plus(1.flt)", "Double");
assertType("1.0.plus(1.lng)", "Double");
assertType("1.0.plus(1)", "Double");
assertType("1f.plus(1d)", "Double");
assertType("1f.plus(1f)", "Float");
assertType("1f.plus(1L)", "Float");
assertType("1f.plus(1)", "Float");
assertType("1.flt.plus(1.dbl)", "Double");
assertType("1.flt.plus(1.flt)", "Float");
assertType("1.flt.plus(1.lng)", "Float");
assertType("1.flt.plus(1)", "Float");
assertType("1L.plus(1d)", "Double");
assertType("1L.plus(1f)", "Float");
assertType("1L.plus(1L)", "Long");
assertType("1L.plus(1)", "Long");
assertType("1.lng.plus(1.dbl)", "Double");
assertType("1.lng.plus(1.flt)", "Float");
assertType("1.lng.plus(1.lng)", "Long");
assertType("1.lng.plus(1)", "Long");
assertType("1.plus(1d)", "Double");
assertType("1.plus(1f)", "Float");
assertType("1.plus(1L)", "Long");
assertType("1.plus(1.dbl)", "Double");
assertType("1.plus(1.flt)", "Float");
assertType("1.plus(1.lng)", "Long");
assertType("1.plus(1)", "Int");
assertType("'1'.plus(1d)", "Double");
assertType("'1'.plus(1f)", "Float");
assertType("'1'.plus(1L)", "Long");
assertType("'1'.plus(1.dbl)", "Double");
assertType("'1'.plus(1.flt)", "Float");
assertType("'1'.plus(1.lng)", "Long");
assertType("'1'.plus(1)", "Int");
assertType("'1'.plus('1')", "Int");
assertType("(1:Short).plus(1d)", "Double");
assertType("(1:Short).plus(1f)", "Float");
assertType("(1:Short).plus(1L)", "Long");
assertType("(1:Short).plus(1.dbl)", "Double");
assertType("(1:Short).plus(1.flt)", "Float");
assertType("(1:Short).plus(1.lng)", "Long");
assertType("(1:Short).plus(1)", "Int");
assertType("(1:Short).plus(1:Short)", "Int");
assertType("(1:Byte).plus(1d)", "Double");
assertType("(1:Byte).plus(1f)", "Float");
assertType("(1:Byte).plus(1L)", "Long");
assertType("(1:Byte).plus(1.dbl)", "Double");
assertType("(1:Byte).plus(1.flt)", "Float");
assertType("(1:Byte).plus(1.lng)", "Long");
assertType("(1:Byte).plus(1)", "Int");
assertType("(1:Byte).plus(1:Short)", "Int");
assertType("(1:Byte).plus(1:Byte)", "Int");
assertType("\"1\".plus(1d)", "String");
assertType("\"1\".plus(1f)", "String");
assertType("\"1\".plus(1L)", "String");
assertType("\"1\".plus(1.dbl)", "String");
assertType("\"1\".plus(1.flt)", "String");
assertType("\"1\".plus(1.lng)", "String");
assertType("\"1\".plus(1)", "String");
assertType("\"1\".plus('1')", "String");
}