Removed tuples from type checker test.

This commit is contained in:
Evgeny Gerashchenko
2013-03-18 22:01:15 +04:00
parent bf28ce155d
commit ffb67d3a1f
2 changed files with 4 additions and 43 deletions
+2
View File
@@ -1,5 +1,7 @@
package testData
class Pair<out A, out B> (val first: A, val second: B}
open class Base_T<T>()
open class Derived_T<T>() : Base_T<T>
open class DDerived_T<T>() : Derived_T<T>
@@ -129,17 +129,11 @@ public class JetTypeCheckerTest extends JetLiteFixture {
assertType("\"d\"", builtIns.getStringType());
assertType("\"\"\"d\"\"\"", builtIns.getStringType());
assertType("#()", KotlinBuiltIns.getInstance().getUnitType());
assertType("Unit.VALUE", KotlinBuiltIns.getInstance().getUnitType());
assertType("null", KotlinBuiltIns.getInstance().getNullableNothingType());
}
public void testTupleConstants() throws Exception {
assertType("#()", KotlinBuiltIns.getInstance().getUnitType());
assertType("#(1, 'a')", KotlinBuiltIns.getInstance().getTupleType(builtIns.getIntType(), builtIns.getCharType()));
}
public void testTypeInfo() throws Exception {
// todo: obsolete since removal of typeinfo
// assertType("typeinfo<Int>", "TypeInfo<Int>");
@@ -269,41 +263,6 @@ public class JetTypeCheckerTest extends JetLiteFixture {
assertNotSubtype("Unit", "Int");
}
public void testTuples() throws Exception {
assertSubtype("Unit", "#()");
assertSubtype("#()", "Unit");
assertSubtype("#()", "#()");
assertSubtype("#(Boolean)", "#(Boolean)");
assertSubtype("#(Byte)", "#(Byte)");
assertSubtype("#(Char)", "#(Char)");
assertSubtype("#(Short)", "#(Short)");
assertSubtype("#(Int)", "#(Int)");
assertSubtype("#(Long)", "#(Long)");
assertSubtype("#(Float)", "#(Float)");
assertSubtype("#(Double)", "#(Double)");
assertSubtype("#(Unit)", "#(Unit)");
assertSubtype("#(Unit, Unit)", "#(Unit, Unit)");
assertSubtype("#(Boolean)", "#(Boolean)");
assertSubtype("#(Byte)", "#(Byte)");
assertSubtype("#(Char)", "#(Char)");
assertSubtype("#(Short)", "#(Short)");
assertSubtype("#(Int)", "#(Int)");
assertSubtype("#(Long)", "#(Long)");
assertSubtype("#(Float)", "#(Float)");
assertSubtype("#(Double)", "#(Double)");
assertSubtype("#(Unit)", "#(Unit)");
assertSubtype("#(Unit, Unit)", "#(Unit, Unit)");
assertNotSubtype("#(Unit)", "#(Int)");
assertSubtype("#(Unit)", "#(Any)");
assertSubtype("#(Unit, Unit)", "#(Any, Any)");
assertSubtype("#(Unit, Unit)", "#(Any, Unit)");
assertSubtype("#(Unit, Unit)", "#(Unit, Any)");
}
public void testProjections() throws Exception {
assertSubtype("Base_T<Int>", "Base_T<Int>");
assertNotSubtype("Base_T<Int>", "Base_T<Any>");
@@ -433,7 +392,7 @@ public class JetTypeCheckerTest extends JetLiteFixture {
public void testOverloads() throws Exception {
assertType("Functions<String>().f()", "Unit");
assertType("Functions<String>().f(1)", "Int");
assertType("Functions<Double>().f(#(1, 1))", "Double");
assertType("Functions<Double>().f(Pair(1, 1))", "Double");
assertType("Functions<Double>().f(1.0)", "Any");
assertType("Functions<Byte>().f<String>(\"\")", "Byte");