diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/JetTypeProjection.java b/compiler/frontend/src/org/jetbrains/kotlin/psi/JetTypeProjection.java index b733f354f83..8756c4490cb 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/JetTypeProjection.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/JetTypeProjection.java @@ -64,6 +64,11 @@ public class JetTypeProjection extends JetModifierListOwnerStub i) { val parameterDescriptor = parameters[i] @@ -282,8 +284,7 @@ public class TypeResolver( } } else { - // TODO : handle the Foo case - val type = resolveType(c.noBareTypes(), argumentElement.getTypeReference()) + val type = resolveType(c.noBareTypes(), argumentElement.getTypeReference()!!) val kind = resolveProjectionKind(projectionKind) if (constructor.getParameters().size() > i) { val parameterDescriptor = constructor.getParameters()[i] diff --git a/compiler/testData/diagnostics/testsWithStdLib/instar.kt b/compiler/testData/diagnostics/testsWithStdLib/instar.kt new file mode 100644 index 00000000000..816e423619f --- /dev/null +++ b/compiler/testData/diagnostics/testsWithStdLib/instar.kt @@ -0,0 +1,11 @@ +// Reproduces exception in TypeResolver.kt: EA-66870 + +import java.util.ArrayList + +abstract class J { + public abstract fun , S : List<in *>> foo(x: T) + fun bar() { + val s = ArrayList>() + foo(s) + } +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/instar.txt b/compiler/testData/diagnostics/testsWithStdLib/instar.txt new file mode 100644 index 00000000000..8c6876abf9d --- /dev/null +++ b/compiler/testData/diagnostics/testsWithStdLib/instar.txt @@ -0,0 +1,10 @@ +package + +internal abstract class J { + public constructor J() + internal final fun bar(): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public abstract fun , /*1*/ S : kotlin.List<*>> foo(/*0*/ x: T): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} diff --git a/compiler/testData/diagnostics/testsWithStdLib/outstar.kt b/compiler/testData/diagnostics/testsWithStdLib/outstar.kt new file mode 100644 index 00000000000..149aa4df681 --- /dev/null +++ b/compiler/testData/diagnostics/testsWithStdLib/outstar.kt @@ -0,0 +1,11 @@ +// Reproduces exception in TypeResolver.kt: EA-66870 + +import java.util.ArrayList + +abstract class J { + public abstract fun , S : List<out *>> foo(x: T) + fun bar() { + val s = ArrayList>() + foo(s) + } +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/outstar.txt b/compiler/testData/diagnostics/testsWithStdLib/outstar.txt new file mode 100644 index 00000000000..8c6876abf9d --- /dev/null +++ b/compiler/testData/diagnostics/testsWithStdLib/outstar.txt @@ -0,0 +1,10 @@ +package + +internal abstract class J { + public constructor J() + internal final fun bar(): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public abstract fun , /*1*/ S : kotlin.List<*>> foo(/*0*/ x: T): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} diff --git a/compiler/tests/org/jetbrains/kotlin/checkers/JetDiagnosticsTestWithStdLibGenerated.java b/compiler/tests/org/jetbrains/kotlin/checkers/JetDiagnosticsTestWithStdLibGenerated.java index d93a9e131f3..60be0d73c8a 100644 --- a/compiler/tests/org/jetbrains/kotlin/checkers/JetDiagnosticsTestWithStdLibGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/checkers/JetDiagnosticsTestWithStdLibGenerated.java @@ -35,6 +35,18 @@ public class JetDiagnosticsTestWithStdLibGenerated extends AbstractJetDiagnostic JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/testsWithStdLib"), Pattern.compile("^(.+)\\.kt$"), true); } + @TestMetadata("instar.kt") + public void testInstar() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/instar.kt"); + doTest(fileName); + } + + @TestMetadata("outstar.kt") + public void testOutstar() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/outstar.kt"); + doTest(fileName); + } + @TestMetadata("compiler/testData/diagnostics/testsWithStdLib/annotations") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class)