Exception fix (equal returns true for the same types) #EA-65206 Fixed

This commit is contained in:
Mikhail Glukhikh
2015-06-02 10:38:04 +03:00
parent bb49bfcea9
commit 46d5290f70
4 changed files with 26 additions and 0 deletions
@@ -0,0 +1,9 @@
class A {
val x = arrayListOf<(A<<!SYNTAX!><!>>) -> Unit>()
// Here we got an exception during type comparison
fun foo(){
<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>x<!>.add {}
}
}
@@ -0,0 +1,10 @@
package
internal final class A {
public constructor A()
internal final val x: java.util.ArrayList<([ERROR : A]<[ERROR : No type element]>) -> kotlin.Unit>
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
internal final fun foo(): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
@@ -603,6 +603,12 @@ public class JetDiagnosticsTestWithStdLibGenerated extends AbstractJetDiagnostic
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/regression/ea63992.kt");
doTest(fileName);
}
@TestMetadata("ea65206.kt")
public void testEa65206() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/regression/ea65206.kt");
doTest(fileName);
}
}
@TestMetadata("compiler/testData/diagnostics/testsWithStdLib/reified")
@@ -70,6 +70,7 @@ public class TypeCheckingProcedure {
}
public boolean equalTypes(@NotNull JetType type1, @NotNull JetType type2) {
if (type1 == type2) return true;
if (TypesPackage.isFlexible(type1)) {
if (TypesPackage.isFlexible(type2)) {
return !type1.isError() && !type2.isError() && isSubtypeOf(type1, type2) && isSubtypeOf(type2, type1);