From c849a0c4e32859c340c1955356fd1cc53b673bdb Mon Sep 17 00:00:00 2001 From: Andrey Breslav Date: Thu, 22 Nov 2012 12:52:14 +0400 Subject: [PATCH] Redundant/conflicting projections --- .../jet/lang/diagnostics/Errors.java | 6 ++++-- .../diagnostics/PositioningStrategies.java | 5 +++-- .../rendering/DefaultErrorMessages.java | 2 ++ .../jet/lang/resolve/TypeResolver.java | 20 +++++++++++++++---- .../diagnostics/tests/ResolveToJava.kt | 2 +- .../ConflictingAndRedundantProjections.kt | 20 +++++++++++++++++++ .../diagnostics/tests/generics/Projections.kt | 13 ++++-------- .../tests/inference/dependOnExpectedType.kt | 4 ++-- .../tests/inference/regressions/kt1410.kt | 8 ++++---- .../tests/regressions/OutProjections.kt | 4 ++-- .../MethodWithTypeParameters.java | 2 +- .../MethodWithTypeParameters.kt | 2 +- .../MethodWithTypeParameters.txt | 2 +- .../WrongTypeParameterBoundStructure1.java | 4 ++-- .../WrongTypeParameterBoundStructure1.kt | 2 +- .../WrongTypeParameterBoundStructure1.txt | 2 +- .../WrongTypeParameterBoundStructure2.java | 4 ++-- .../WrongTypeParameterBoundStructure2.kt | 2 +- .../WrongTypeParameterBoundStructure2.txt | 2 +- .../error/WrongTypeVariance.java | 4 ++-- .../error/WrongTypeVariance.kt | 2 +- .../error/WrongTypeVariance.txt | 2 +- .../checkers/JetDiagnosticsTestGenerated.java | 5 +++++ idea/testData/checker/ResolveToJava.kt | 2 +- 24 files changed, 79 insertions(+), 42 deletions(-) create mode 100644 compiler/testData/diagnostics/tests/declarationChecks/ConflictingAndRedundantProjections.kt diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/Errors.java b/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/Errors.java index 30ee888f36c..e9a97d49ca4 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/Errors.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/Errors.java @@ -86,11 +86,13 @@ public interface Errors { //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - SimpleDiagnosticFactory PROJECTION_ON_NON_CLASS_TYPE_ARGUMENT = SimpleDiagnosticFactory.create(ERROR, PROJECTION_MODIFIER); + SimpleDiagnosticFactory PROJECTION_ON_NON_CLASS_TYPE_ARGUMENT = SimpleDiagnosticFactory.create(ERROR, VARIANCE_IN_PROJECTION); DiagnosticFactory2 UPPER_BOUND_VIOLATED = DiagnosticFactory2.create(ERROR); SimpleDiagnosticFactory REDUNDANT_NULLABLE = SimpleDiagnosticFactory.create(WARNING, NULLABLE_TYPE); DiagnosticFactory1 BASE_WITH_NULLABLE_UPPER_BOUND = DiagnosticFactory1.create(WARNING, NULLABLE_TYPE); DiagnosticFactory1 WRONG_NUMBER_OF_TYPE_ARGUMENTS = DiagnosticFactory1.create(ERROR); + DiagnosticFactory1 CONFLICTING_PROJECTION = DiagnosticFactory1.create(ERROR, VARIANCE_IN_PROJECTION); + DiagnosticFactory1 REDUNDANT_PROJECTION = DiagnosticFactory1.create(WARNING, VARIANCE_IN_PROJECTION); //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -121,7 +123,7 @@ public interface Errors { // Classes and traits SimpleDiagnosticFactory PROJECTION_IN_IMMEDIATE_ARGUMENT_TO_SUPERTYPE = - SimpleDiagnosticFactory.create(ERROR, PROJECTION_MODIFIER); + SimpleDiagnosticFactory.create(ERROR, VARIANCE_IN_PROJECTION); SimpleDiagnosticFactory CYCLIC_INHERITANCE_HIERARCHY = SimpleDiagnosticFactory.create(ERROR); diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/PositioningStrategies.java b/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/PositioningStrategies.java index 34265afd56c..d551eed62de 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/PositioningStrategies.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/PositioningStrategies.java @@ -183,7 +183,8 @@ public class PositioningStrategies { }; } - public static final PositioningStrategy VARIANCE_MODIFIER = modifierSetPosition(JetTokens.IN_KEYWORD, JetTokens.OUT_KEYWORD); + public static final PositioningStrategy VARIANCE_MODIFIER = modifierSetPosition(JetTokens.IN_KEYWORD, + JetTokens.OUT_KEYWORD); public static PositioningStrategy modifierSetPosition(final JetKeywordToken... tokens) { return new PositioningStrategy() { @@ -233,7 +234,7 @@ public class PositioningStrategies { } }; - public static final PositioningStrategy PROJECTION_MODIFIER = new PositioningStrategy() { + public static final PositioningStrategy VARIANCE_IN_PROJECTION = new PositioningStrategy() { @NotNull @Override public List mark(@NotNull JetTypeProjection element) { diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/rendering/DefaultErrorMessages.java b/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/rendering/DefaultErrorMessages.java index 3fd3bc7f465..ba2893893b6 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/rendering/DefaultErrorMessages.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/rendering/DefaultErrorMessages.java @@ -320,6 +320,8 @@ public class DefaultErrorMessages { NAME); MAP.put(VARIANCE_ON_FUNCTION_OR_PROPERTY_PARAMETER, "Variance annotations are only allowed for type parameters of classes and traits"); + MAP.put(REDUNDANT_PROJECTION, "Projection is redundant: the corresponding type parameter of {0} has the same variance", NAME); + MAP.put(CONFLICTING_PROJECTION, "Projection is conflicting with variance of the corresponding type parameter of {0}. Remove the projection or replace it with ''*''", NAME); MAP.put(TYPE_MISMATCH_IN_FOR_LOOP, "The loop iterates over values of type {0} but the parameter is declared to be {1}", RENDER_TYPE, RENDER_TYPE); diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/TypeResolver.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/TypeResolver.java index 056cd6a76bf..cb73f670b83 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/TypeResolver.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/TypeResolver.java @@ -38,6 +38,7 @@ import java.util.Collections; import java.util.List; import static org.jetbrains.jet.lang.diagnostics.Errors.*; +import static org.jetbrains.jet.lang.types.Variance.*; /** * @author abreslav @@ -269,7 +270,7 @@ public class TypeResolver { arguments.add(SubstitutionUtils.makeStarProjection(parameterDescriptor)); } else { - arguments.add(new TypeProjection(Variance.OUT_VARIANCE, ErrorUtils.createErrorType("*"))); + arguments.add(new TypeProjection(OUT_VARIANCE, ErrorUtils.createErrorType("*"))); } } else { @@ -278,16 +279,27 @@ public class TypeResolver { Variance kind = null; switch (projectionKind) { case IN: - kind = Variance.IN_VARIANCE; + kind = IN_VARIANCE; break; case OUT: - kind = Variance.OUT_VARIANCE; + kind = OUT_VARIANCE; break; case NONE: - kind = Variance.INVARIANT; + kind = INVARIANT; break; } assert kind != null; + if (constructor.getParameters().size() > i) { + TypeParameterDescriptor parameterDescriptor = constructor.getParameters().get(i); + if (kind != INVARIANT && parameterDescriptor.getVariance() != INVARIANT) { + if (kind == parameterDescriptor.getVariance()) { + trace.report(REDUNDANT_PROJECTION.on(argumentElement, constructor.getDeclarationDescriptor())); + } + else { + trace.report(CONFLICTING_PROJECTION.on(argumentElement, constructor.getDeclarationDescriptor())); + } + } + } arguments.add(new TypeProjection(kind, type)); } } diff --git a/compiler/testData/diagnostics/tests/ResolveToJava.kt b/compiler/testData/diagnostics/tests/ResolveToJava.kt index d797ccd5395..4959e4a4153 100644 --- a/compiler/testData/diagnostics/tests/ResolveToJava.kt +++ b/compiler/testData/diagnostics/tests/ResolveToJava.kt @@ -7,7 +7,7 @@ import utils.* import java.io.PrintStream import java.lang.Comparable as Com -val l : List = ArrayList() +val l : MutableList = ArrayList() fun test(l : java.util.List) { val x : java.List diff --git a/compiler/testData/diagnostics/tests/declarationChecks/ConflictingAndRedundantProjections.kt b/compiler/testData/diagnostics/tests/declarationChecks/ConflictingAndRedundantProjections.kt new file mode 100644 index 00000000000..062569c59cf --- /dev/null +++ b/compiler/testData/diagnostics/tests/declarationChecks/ConflictingAndRedundantProjections.kt @@ -0,0 +1,20 @@ +class In +class Out +class Inv +class X + +fun f1(p: In<in X>) {} +fun f2(p: In<out X>) {} +fun f3(p: In) {} + +fun f4(p: Out<out X>) {} +fun f5(p: Out<in X>) {} +fun f6(p: Out) {} + +fun f6(p: Inv) {} +fun f7(p: Inv) {} +fun f8(p: Inv) {} + +fun f9(p: In<*>) {} +fun f10(p: Out<*>) {} +fun f11(p: Inv<*>) {} diff --git a/compiler/testData/diagnostics/tests/generics/Projections.kt b/compiler/testData/diagnostics/tests/generics/Projections.kt index f2fdba24b41..abb986a4a7a 100644 --- a/compiler/testData/diagnostics/tests/generics/Projections.kt +++ b/compiler/testData/diagnostics/tests/generics/Projections.kt @@ -17,24 +17,19 @@ class Inv() { fun testInOut() { In().f("1"); - (null as In).f("1") - (null as In).f("1") // Wrong Arg + (null as In<in String>).f("1") (null as In<*>).f("1") // Wrong Arg In().f(1); - (null as In).f(1) - (null as In).f(1) - (null as In).f1(1) // !! + (null as In<in String>).f(1) (null as In<*>).f(1); Out().f(1) - (null as Out).f(1) - (null as Out).f(1) + (null as Out<out Int>).f(1) (null as Out<*>).f(1) Out().f() - (null as Out).f() - (null as Out).f() + (null as Out<out Int>).f() (null as Out<*>).f() Inv().f(1) diff --git a/compiler/testData/diagnostics/tests/inference/dependOnExpectedType.kt b/compiler/testData/diagnostics/tests/inference/dependOnExpectedType.kt index 4198f557e87..74473c7f38f 100644 --- a/compiler/testData/diagnostics/tests/inference/dependOnExpectedType.kt +++ b/compiler/testData/diagnostics/tests/inference/dependOnExpectedType.kt @@ -36,8 +36,8 @@ fun test1() { val i = both(1, "") val j = both(id(1), id("")) - i : Comparable - j : Comparable + i : Comparable<*> + j : Comparable<*> } fun list(value: T) : ArrayList { diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt1410.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt1410.kt index a8041192cc3..f12b3c06652 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt1410.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt1410.kt @@ -2,7 +2,7 @@ //+JDK package d -public fun Collection.filterToMy(result : MutableList, filter : (T) -> Boolean) : Collection { +public fun MutableCollection.filterToMy(result : MutableList, filter : (T) -> Boolean) : MutableCollection { for (t in this){ if (filter(t)){ result.add(t) @@ -11,13 +11,13 @@ public fun Collection.filterToMy(result : MutableList, filter : return this } -fun foo(result: MutableList, val collection: Collection, prefix : String){ +fun foo(result: MutableList, val collection: MutableCollection, prefix : String){ collection.filterToMy(result, {it.startsWith(prefix)}) } -fun test(result: MutableList, val collection: Collection, prefix : String){ +fun test(result: MutableList, val collection: MutableCollection, prefix : String){ val c = collection.filterToMy(result, {it.startsWith(prefix)}) - c: Collection + c: MutableCollection } //from library diff --git a/compiler/testData/diagnostics/tests/regressions/OutProjections.kt b/compiler/testData/diagnostics/tests/regressions/OutProjections.kt index 6860b429b93..33bc6c020b5 100644 --- a/compiler/testData/diagnostics/tests/regressions/OutProjections.kt +++ b/compiler/testData/diagnostics/tests/regressions/OutProjections.kt @@ -13,9 +13,9 @@ fun foo() : G { class Out() {} -fun fout(expression : T) : Out = Out() +fun fout(expression : T) : Out<out T> = Out() fun fooout() : Out { val p = Point(); return fout(p); -} +} \ No newline at end of file diff --git a/compiler/testData/loadJava/kotlinSignature/MethodWithTypeParameters.java b/compiler/testData/loadJava/kotlinSignature/MethodWithTypeParameters.java index 9fa5cc63ce1..11515052502 100644 --- a/compiler/testData/loadJava/kotlinSignature/MethodWithTypeParameters.java +++ b/compiler/testData/loadJava/kotlinSignature/MethodWithTypeParameters.java @@ -8,7 +8,7 @@ import java.util.List; import jet.runtime.typeinfo.KotlinSignature; public class MethodWithTypeParameters { - @KotlinSignature("fun foo(a : A, b : List, c: List) where B : List") + @KotlinSignature("fun foo(a : A, b : List, c: MutableList) where B : List") public > void foo(A a, List b, List list) { } } diff --git a/compiler/testData/loadJava/kotlinSignature/MethodWithTypeParameters.kt b/compiler/testData/loadJava/kotlinSignature/MethodWithTypeParameters.kt index 4343d479f16..f83804504fd 100644 --- a/compiler/testData/loadJava/kotlinSignature/MethodWithTypeParameters.kt +++ b/compiler/testData/loadJava/kotlinSignature/MethodWithTypeParameters.kt @@ -3,6 +3,6 @@ package test import java.util.* public open class MethodWithTypeParameters : Object() { - public open fun foo(p0 : A, p1 : List, p2: List) where B : List { + public open fun foo(p0 : A, p1 : List, p2: MutableList) where B : List { } } diff --git a/compiler/testData/loadJava/kotlinSignature/MethodWithTypeParameters.txt b/compiler/testData/loadJava/kotlinSignature/MethodWithTypeParameters.txt index 985fa40f97e..cdcbfbf66b1 100644 --- a/compiler/testData/loadJava/kotlinSignature/MethodWithTypeParameters.txt +++ b/compiler/testData/loadJava/kotlinSignature/MethodWithTypeParameters.txt @@ -2,5 +2,5 @@ namespace test public open class test.MethodWithTypeParameters : java.lang.Object { public final /*constructor*/ fun (): test.MethodWithTypeParameters - public open fun >foo(/*0*/ p0: A, /*1*/ p1: jet.List, /*2*/ p2: jet.List): jet.Tuple0 + public open fun >foo(/*0*/ p0: A, /*1*/ p1: jet.List, /*2*/ p2: jet.MutableList): jet.Tuple0 } diff --git a/compiler/testData/loadJava/kotlinSignature/error/WrongTypeParameterBoundStructure1.java b/compiler/testData/loadJava/kotlinSignature/error/WrongTypeParameterBoundStructure1.java index 2493b5086f9..65e7ea5dbb7 100644 --- a/compiler/testData/loadJava/kotlinSignature/error/WrongTypeParameterBoundStructure1.java +++ b/compiler/testData/loadJava/kotlinSignature/error/WrongTypeParameterBoundStructure1.java @@ -7,7 +7,7 @@ import org.jetbrains.jet.jvm.compiler.annotation.ExpectLoadError; public class WrongTypeParameterBoundStructure1 { @ExpectLoadError("'java.lang.Runnable?' type in method signature has 0 type arguments, while 'Runnable' in alternative signature has 1 of them") - @KotlinSignature("fun > foo(a : A, b : List, c: List) where B : List") - public > void foo(A a, List b, List list) { + @KotlinSignature("fun > foo(a : A, b : List) where B : List") + public > void foo(A a, List b) { } } diff --git a/compiler/testData/loadJava/kotlinSignature/error/WrongTypeParameterBoundStructure1.kt b/compiler/testData/loadJava/kotlinSignature/error/WrongTypeParameterBoundStructure1.kt index 8dd4d5e9288..21dac2f336c 100644 --- a/compiler/testData/loadJava/kotlinSignature/error/WrongTypeParameterBoundStructure1.kt +++ b/compiler/testData/loadJava/kotlinSignature/error/WrongTypeParameterBoundStructure1.kt @@ -3,6 +3,6 @@ package test import java.util.* public open class WrongTypeParameterBoundStructure1 : Object() { - public open fun foo(p0 : A?, p1 : List?, p2: List?) where B : List? { + public open fun foo(p0 : A?, p1 : List?) where B : List? { } } diff --git a/compiler/testData/loadJava/kotlinSignature/error/WrongTypeParameterBoundStructure1.txt b/compiler/testData/loadJava/kotlinSignature/error/WrongTypeParameterBoundStructure1.txt index 6020642cadf..5e9e2671a71 100644 --- a/compiler/testData/loadJava/kotlinSignature/error/WrongTypeParameterBoundStructure1.txt +++ b/compiler/testData/loadJava/kotlinSignature/error/WrongTypeParameterBoundStructure1.txt @@ -2,5 +2,5 @@ namespace test public open class test.WrongTypeParameterBoundStructure1 : java.lang.Object { public final /*constructor*/ fun (): test.WrongTypeParameterBoundStructure1 - public open fun ?>foo(/*0*/ p0: A?, /*1*/ p1: jet.List?, /*2*/ p2: jet.List?): jet.Tuple0 + public open fun ?>foo(/*0*/ p0: A?, /*1*/ p1: jet.List?): jet.Tuple0 } diff --git a/compiler/testData/loadJava/kotlinSignature/error/WrongTypeParameterBoundStructure2.java b/compiler/testData/loadJava/kotlinSignature/error/WrongTypeParameterBoundStructure2.java index 9120dd812be..9c2edc245cb 100644 --- a/compiler/testData/loadJava/kotlinSignature/error/WrongTypeParameterBoundStructure2.java +++ b/compiler/testData/loadJava/kotlinSignature/error/WrongTypeParameterBoundStructure2.java @@ -7,7 +7,7 @@ import org.jetbrains.jet.jvm.compiler.annotation.ExpectLoadError; public class WrongTypeParameterBoundStructure2 { @ExpectLoadError("'jet.List?' type in method signature has 1 type arguments, while 'List' in alternative signature has 0 of them") - @KotlinSignature("fun foo(a : A, b : List, c: List) where B : List") - public > void foo(A a, List b, List list) { + @KotlinSignature("fun foo(a : A, b : List) where B : List") + public > void foo(A a, List b) { } } diff --git a/compiler/testData/loadJava/kotlinSignature/error/WrongTypeParameterBoundStructure2.kt b/compiler/testData/loadJava/kotlinSignature/error/WrongTypeParameterBoundStructure2.kt index 237e6cf856a..37b98b37864 100644 --- a/compiler/testData/loadJava/kotlinSignature/error/WrongTypeParameterBoundStructure2.kt +++ b/compiler/testData/loadJava/kotlinSignature/error/WrongTypeParameterBoundStructure2.kt @@ -3,6 +3,6 @@ package test import java.util.* public open class WrongTypeParameterBoundStructure2 : Object() { - public open fun foo(p0 : A?, p1 : List?, p2: List?) where B : List? { + public open fun foo(p0 : A?, p1 : List?) where B : List? { } } diff --git a/compiler/testData/loadJava/kotlinSignature/error/WrongTypeParameterBoundStructure2.txt b/compiler/testData/loadJava/kotlinSignature/error/WrongTypeParameterBoundStructure2.txt index 548dc37963c..2923e7e3112 100644 --- a/compiler/testData/loadJava/kotlinSignature/error/WrongTypeParameterBoundStructure2.txt +++ b/compiler/testData/loadJava/kotlinSignature/error/WrongTypeParameterBoundStructure2.txt @@ -2,5 +2,5 @@ namespace test public open class test.WrongTypeParameterBoundStructure2 : java.lang.Object { public final /*constructor*/ fun (): test.WrongTypeParameterBoundStructure2 - public open fun ?>foo(/*0*/ p0: A?, /*1*/ p1: jet.List?, /*2*/ p2: jet.List?): jet.Tuple0 + public open fun ?>foo(/*0*/ p0: A?, /*1*/ p1: jet.List?): jet.Tuple0 } diff --git a/compiler/testData/loadJava/kotlinSignature/error/WrongTypeVariance.java b/compiler/testData/loadJava/kotlinSignature/error/WrongTypeVariance.java index 4b4aca1655a..ca276fa76e8 100644 --- a/compiler/testData/loadJava/kotlinSignature/error/WrongTypeVariance.java +++ b/compiler/testData/loadJava/kotlinSignature/error/WrongTypeVariance.java @@ -6,9 +6,9 @@ import jet.runtime.typeinfo.KotlinSignature; import org.jetbrains.jet.jvm.compiler.annotation.ExpectLoadError; public class WrongTypeVariance { - @ExpectLoadError("Variance mismatch, actual: in, in alternative signature: ") + @ExpectLoadError("Variance mismatch, actual: out, in alternative signature: ") @KotlinSignature("fun copy(a : List, b : List) : MutableList") - public List copy(List from, List to) { + public List copy(List from, List to) { throw new UnsupportedOperationException(); } } diff --git a/compiler/testData/loadJava/kotlinSignature/error/WrongTypeVariance.kt b/compiler/testData/loadJava/kotlinSignature/error/WrongTypeVariance.kt index 6c1211c775c..69220ff10ba 100644 --- a/compiler/testData/loadJava/kotlinSignature/error/WrongTypeVariance.kt +++ b/compiler/testData/loadJava/kotlinSignature/error/WrongTypeVariance.kt @@ -3,7 +3,7 @@ package test import java.util.* public open class WrongTypeVariance : Object() { - public open fun copy(p0 : List?, p1 : List?) : MutableList? { + public open fun copy(p0 : List?, p1 : List?) : MutableList? { throw UnsupportedOperationException() } } diff --git a/compiler/testData/loadJava/kotlinSignature/error/WrongTypeVariance.txt b/compiler/testData/loadJava/kotlinSignature/error/WrongTypeVariance.txt index 17a7336f056..fcb164e792e 100644 --- a/compiler/testData/loadJava/kotlinSignature/error/WrongTypeVariance.txt +++ b/compiler/testData/loadJava/kotlinSignature/error/WrongTypeVariance.txt @@ -2,5 +2,5 @@ namespace test public open class test.WrongTypeVariance : java.lang.Object { public final /*constructor*/ fun (): test.WrongTypeVariance - public open fun copy(/*0*/ p0: jet.List?, /*1*/ p1: jet.List?): jet.MutableList? + public open fun copy(/*0*/ p0: jet.List?, /*1*/ p1: jet.List?): jet.MutableList? } diff --git a/compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTestGenerated.java b/compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTestGenerated.java index 5455d23d521..6308fd7d7e1 100644 --- a/compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTestGenerated.java +++ b/compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTestGenerated.java @@ -1382,6 +1382,11 @@ public class JetDiagnosticsTestGenerated extends AbstractDiagnosticsTestWithEage doTest("compiler/testData/diagnostics/tests/declarationChecks/ComponentFunctionReturnTypeMismatch.kt"); } + @TestMetadata("ConflictingAndRedundantProjections.kt") + public void testConflictingAndRedundantProjections() throws Exception { + doTest("compiler/testData/diagnostics/tests/declarationChecks/ConflictingAndRedundantProjections.kt"); + } + @TestMetadata("DataFlowInMultiDeclInFor.kt") public void testDataFlowInMultiDeclInFor() throws Exception { doTest("compiler/testData/diagnostics/tests/declarationChecks/DataFlowInMultiDeclInFor.kt"); diff --git a/idea/testData/checker/ResolveToJava.kt b/idea/testData/checker/ResolveToJava.kt index d2d123c658b..762cf70beac 100644 --- a/idea/testData/checker/ResolveToJava.kt +++ b/idea/testData/checker/ResolveToJava.kt @@ -5,7 +5,7 @@ import utils.* import java.io.PrintStream import java.lang.Comparable as Com -val l : List = ArrayList() +val l : MutableList = ArrayList() fun test(l : List) { val x : java.List