Do not create KotlinTypeImpl with error scope while erasing

See assertion in KotlinTypeImpl init block
This commit is contained in:
Denis Zharkov
2015-11-30 19:08:19 +03:00
parent e2b51f30ed
commit 8838e46578
4 changed files with 37 additions and 0 deletions
@@ -0,0 +1,12 @@
// FILE: A.java
import java.util.*;
public class A<T> {
public void foo(Err<String> x, List<String> y);
}
// FILE: B.java
public class B extends A {
}
@@ -0,0 +1,17 @@
package
public open class A</*0*/ T : kotlin.Any!> {
public constructor A</*0*/ T : kotlin.Any!>()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open fun foo(/*0*/ x: [ERROR : Unresolved java classifier: Err<String>]!, /*1*/ y: kotlin.(Mutable)List<kotlin.String!>!): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public open class B : A<kotlin.Any!> {
public constructor B()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any(raw)?): kotlin.Boolean(raw)
public open override /*1*/ /*fake_override*/ fun foo(/*0*/ x: [ERROR : Unresolved java classifier: Err<String>]!, /*1*/ y: kotlin.(Mutable)List<(raw) kotlin.Any?>!): kotlin.Unit(raw)
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int(raw)
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String(raw)
}
@@ -11903,6 +11903,12 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
doTest(fileName);
}
@TestMetadata("errorType.kt")
public void testErrorType() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/platformTypes/rawTypes/errorType.kt");
doTest(fileName);
}
@TestMetadata("genericInnerClass.kt")
public void testGenericInnerClass() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/platformTypes/rawTypes/genericInnerClass.kt");
@@ -114,6 +114,8 @@ internal object RawSubstitution : TypeSubstitution() {
)
}
if (type.isError) return ErrorUtils.createErrorType("Raw error type: ${type.constructor}")
val constructor = type.constructor
return KotlinTypeImpl.create(
type.annotations, constructor, type.isMarkedNullable,