From 0b385cc53283800495d81ea57a436e4b735555ee Mon Sep 17 00:00:00 2001 From: Denis Zharkov Date: Mon, 23 Dec 2019 18:03:54 +0300 Subject: [PATCH] NI: Approximate captured-for-star-projections to * ^KT-35602 Fixed --- ...irOldFrontendDiagnosticsTestGenerated.java | 15 ++ .../kotlin/types/TypeApproximator.kt | 11 + .../tests/inference/starApproximation.fir.kt | 22 ++ .../tests/inference/starApproximation.kt | 22 ++ .../starApproximationBangBang.fir.kt | 24 ++ .../inference/starApproximationBangBang.kt | 24 ++ .../starApproximationFlexible.fir.kt | 29 +++ .../inference/starApproximationFlexible.kt | 29 +++ .../diagnostics/notLinked/dfa/pos/12.kt | 222 +++++++++--------- .../diagnostics/notLinked/dfa/pos/13.kt | 222 +++++++++--------- .../diagnostics/notLinked/dfa/pos/38.kt | 6 +- .../diagnostics/notLinked/dfa/pos/55.kt | 6 +- .../checkers/DiagnosticsTestGenerated.java | 15 ++ .../DiagnosticsUsingJavacTestGenerated.java | 15 ++ 14 files changed, 434 insertions(+), 228 deletions(-) create mode 100644 compiler/testData/diagnostics/tests/inference/starApproximation.fir.kt create mode 100644 compiler/testData/diagnostics/tests/inference/starApproximation.kt create mode 100644 compiler/testData/diagnostics/tests/inference/starApproximationBangBang.fir.kt create mode 100644 compiler/testData/diagnostics/tests/inference/starApproximationBangBang.kt create mode 100644 compiler/testData/diagnostics/tests/inference/starApproximationFlexible.fir.kt create mode 100644 compiler/testData/diagnostics/tests/inference/starApproximationFlexible.kt diff --git a/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirOldFrontendDiagnosticsTestGenerated.java b/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirOldFrontendDiagnosticsTestGenerated.java index d6c53e419c6..65dfc9b5554 100644 --- a/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirOldFrontendDiagnosticsTestGenerated.java +++ b/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirOldFrontendDiagnosticsTestGenerated.java @@ -10003,6 +10003,21 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirOldFronte runTest("compiler/testData/diagnostics/tests/inference/reportAboutUnresolvedReferenceAsUnresolved.kt"); } + @TestMetadata("starApproximation.kt") + public void testStarApproximation() throws Exception { + runTest("compiler/testData/diagnostics/tests/inference/starApproximation.kt"); + } + + @TestMetadata("starApproximationBangBang.kt") + public void testStarApproximationBangBang() throws Exception { + runTest("compiler/testData/diagnostics/tests/inference/starApproximationBangBang.kt"); + } + + @TestMetadata("starApproximationFlexible.kt") + public void testStarApproximationFlexible() throws Exception { + runTest("compiler/testData/diagnostics/tests/inference/starApproximationFlexible.kt"); + } + @TestMetadata("tryNumberLowerBoundsBeforeUpperBounds.kt") public void testTryNumberLowerBoundsBeforeUpperBounds() throws Exception { runTest("compiler/testData/diagnostics/tests/inference/tryNumberLowerBoundsBeforeUpperBounds.kt"); diff --git a/compiler/resolution/src/org/jetbrains/kotlin/types/TypeApproximator.kt b/compiler/resolution/src/org/jetbrains/kotlin/types/TypeApproximator.kt index a44d13e979c..c3ff7d12115 100644 --- a/compiler/resolution/src/org/jetbrains/kotlin/types/TypeApproximator.kt +++ b/compiler/resolution/src/org/jetbrains/kotlin/types/TypeApproximator.kt @@ -485,6 +485,17 @@ abstract class AbstractTypeApproximator(val ctx: TypeSystemInferenceExtensionCon val argumentType = newArguments[index]?.getType() ?: argument.getType() + val capturedStarProjectionOrNull = + argumentType.lowerBoundIfFlexible().asCapturedType()?.typeConstructorProjection()?.takeIf { it.isStarProjection() } + + if (capturedStarProjectionOrNull != null && + (effectiveVariance == TypeVariance.OUT || effectiveVariance == TypeVariance.INV) && + toSuper + ) { + newArguments[index] = capturedStarProjectionOrNull + continue@loop + } + when (effectiveVariance) { null -> { return if (conf.errorType) { diff --git a/compiler/testData/diagnostics/tests/inference/starApproximation.fir.kt b/compiler/testData/diagnostics/tests/inference/starApproximation.fir.kt new file mode 100644 index 00000000000..829f9f6f893 --- /dev/null +++ b/compiler/testData/diagnostics/tests/inference/starApproximation.fir.kt @@ -0,0 +1,22 @@ +// SKIP_TXT +// !LANGUAGE: +NewInference + +interface Self> { + val x: E +} +fun bar(): Self<*> = TODO() + +interface OutSelf> { + val x: E +} +fun outBar(): OutSelf<*> = TODO() + +fun id(x: X): X = x + +fun main() { + bar().x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x + id(bar()).x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x + + outBar().x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x + id(outBar()).x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x +} diff --git a/compiler/testData/diagnostics/tests/inference/starApproximation.kt b/compiler/testData/diagnostics/tests/inference/starApproximation.kt new file mode 100644 index 00000000000..829f9f6f893 --- /dev/null +++ b/compiler/testData/diagnostics/tests/inference/starApproximation.kt @@ -0,0 +1,22 @@ +// SKIP_TXT +// !LANGUAGE: +NewInference + +interface Self> { + val x: E +} +fun bar(): Self<*> = TODO() + +interface OutSelf> { + val x: E +} +fun outBar(): OutSelf<*> = TODO() + +fun id(x: X): X = x + +fun main() { + bar().x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x + id(bar()).x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x + + outBar().x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x + id(outBar()).x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x +} diff --git a/compiler/testData/diagnostics/tests/inference/starApproximationBangBang.fir.kt b/compiler/testData/diagnostics/tests/inference/starApproximationBangBang.fir.kt new file mode 100644 index 00000000000..a3d19c16767 --- /dev/null +++ b/compiler/testData/diagnostics/tests/inference/starApproximationBangBang.fir.kt @@ -0,0 +1,24 @@ +// SKIP_TXT +// !LANGUAGE: +NewInference + +interface Self> { + val x: E +} +fun bar(): Self<*> = TODO() +fun foo(): Self<*>? = TODO() + +interface OutSelf> { + val x: E +} +fun outBar(): OutSelf<*> = TODO() +fun outFoo(): OutSelf<*>? = TODO() + +fun main() { + bar().x.x.x.x.x.x.x.x.x.x.x.x.x // OK + foo()!!.x.x.x.x.x.x // OK + foo()!!.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x // unresolved x in NI + + outBar().x.x.x.x.x.x.x.x.x.x.x.x.x // OK + outFoo()!!.x.x.x.x.x.x // OK + outFoo()!!.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x // unresolved x in NI +} diff --git a/compiler/testData/diagnostics/tests/inference/starApproximationBangBang.kt b/compiler/testData/diagnostics/tests/inference/starApproximationBangBang.kt new file mode 100644 index 00000000000..a3d19c16767 --- /dev/null +++ b/compiler/testData/diagnostics/tests/inference/starApproximationBangBang.kt @@ -0,0 +1,24 @@ +// SKIP_TXT +// !LANGUAGE: +NewInference + +interface Self> { + val x: E +} +fun bar(): Self<*> = TODO() +fun foo(): Self<*>? = TODO() + +interface OutSelf> { + val x: E +} +fun outBar(): OutSelf<*> = TODO() +fun outFoo(): OutSelf<*>? = TODO() + +fun main() { + bar().x.x.x.x.x.x.x.x.x.x.x.x.x // OK + foo()!!.x.x.x.x.x.x // OK + foo()!!.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x // unresolved x in NI + + outBar().x.x.x.x.x.x.x.x.x.x.x.x.x // OK + outFoo()!!.x.x.x.x.x.x // OK + outFoo()!!.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x // unresolved x in NI +} diff --git a/compiler/testData/diagnostics/tests/inference/starApproximationFlexible.fir.kt b/compiler/testData/diagnostics/tests/inference/starApproximationFlexible.fir.kt new file mode 100644 index 00000000000..d55771f96b1 --- /dev/null +++ b/compiler/testData/diagnostics/tests/inference/starApproximationFlexible.fir.kt @@ -0,0 +1,29 @@ +// SKIP_TXT +// !LANGUAGE: +NewInference + +// FILE: JavaClass.java +public class JavaClass { + public static > Self id1Inv(T t) { return null; } + public static > T id2Inv(T t) { return null; } + public static > OutSelf id1Out(T t) { return null; } + public static > T id2Out(T t) { return null; } +} + +// FILE: main.kt +interface Self> { + val x: E +} +fun bar(): Self<*> = TODO() + +interface OutSelf> { + val x: E +} +fun outBar(): OutSelf<*> = TODO() + +fun main() { + JavaClass.id1Inv(bar()).x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x + JavaClass.id2Inv(bar()).x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x + + JavaClass.id1Out(outBar()).x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x + JavaClass.id2Out(outBar()).x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x +} diff --git a/compiler/testData/diagnostics/tests/inference/starApproximationFlexible.kt b/compiler/testData/diagnostics/tests/inference/starApproximationFlexible.kt new file mode 100644 index 00000000000..d55771f96b1 --- /dev/null +++ b/compiler/testData/diagnostics/tests/inference/starApproximationFlexible.kt @@ -0,0 +1,29 @@ +// SKIP_TXT +// !LANGUAGE: +NewInference + +// FILE: JavaClass.java +public class JavaClass { + public static > Self id1Inv(T t) { return null; } + public static > T id2Inv(T t) { return null; } + public static > OutSelf id1Out(T t) { return null; } + public static > T id2Out(T t) { return null; } +} + +// FILE: main.kt +interface Self> { + val x: E +} +fun bar(): Self<*> = TODO() + +interface OutSelf> { + val x: E +} +fun outBar(): OutSelf<*> = TODO() + +fun main() { + JavaClass.id1Inv(bar()).x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x + JavaClass.id2Inv(bar()).x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x + + JavaClass.id1Out(outBar()).x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x + JavaClass.id2Out(outBar()).x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x +} diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/12.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/12.kt index 564acffc41a..67dac68bbf2 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/12.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/12.kt @@ -1827,7 +1827,7 @@ fun Map?.case_32() { funNullableAny() isEmpty() apply { - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this equals(null) propT propAny @@ -1838,29 +1838,29 @@ fun Map?.case_32() { funNullableT() funNullableAny() isEmpty() - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.equals(null) - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.propT - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.propAny - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.propNullableT - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.propNullableAny - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.funT() - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.funAny() - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.funNullableT() - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.funNullableAny() - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.isEmpty() + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.equals(null) + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.propT + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.propAny + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.propNullableT + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.propNullableAny + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.funT() + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.funAny() + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.funNullableT() + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.funNullableAny() + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.isEmpty() } also { - ")!>it - ")!>it.equals(null) - ")!>it.propT - ")!>it.propAny - ")!>it.propNullableT - ")!>it.propNullableAny - ")!>it.funT() - ")!>it.funAny() - ")!>it.funNullableT() - ")!>it.funNullableAny() - ")!>it.isEmpty() + ")!>it + ")!>it.equals(null) + ")!>it.propT + ")!>it.propAny + ")!>it.propNullableT + ")!>it.propNullableAny + ")!>it.funT() + ")!>it.funAny() + ")!>it.funNullableT() + ")!>it.funNullableAny() + ")!>it.isEmpty() } } } @@ -1899,7 +1899,7 @@ fun InterfaceWithFiveTypeParameters1?.case_33() { funNullableAny() itest() apply { - "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this + "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this equals(null) propT propAny @@ -1910,29 +1910,29 @@ fun InterfaceWithFiveTypeParameters1?.case_33() { funNullableT() funNullableAny() itest() - "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.equals(null) - "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.propT - "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.propAny - "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.propNullableT - "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.propNullableAny - "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.funT() - "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.funAny() - "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.funNullableT() - "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.funNullableAny() - "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.itest() + "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.equals(null) + "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.propT + "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.propAny + "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.propNullableT + "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.propNullableAny + "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.funT() + "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.funAny() + "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.funNullableT() + "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.funNullableAny() + "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.itest() } also { - ")!>it - ")!>it.equals(null) - ")!>it.propT - ")!>it.propAny - ")!>it.propNullableT - ")!>it.propNullableAny - ")!>it.funT() - ")!>it.funAny() - ")!>it.funNullableT() - ")!>it.funNullableAny() - ")!>it.itest() + ")!>it + ")!>it.equals(null) + ")!>it.propT + ")!>it.propAny + ")!>it.propNullableT + ")!>it.propNullableAny + ")!>it.funT() + ")!>it.funAny() + ")!>it.funNullableT() + ")!>it.funNullableAny() + ")!>it.itest() } } } @@ -2187,7 +2187,7 @@ fun Map?.case_37() { funNullableAny() isEmpty() apply { - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this equals(null) propT propAny @@ -2198,29 +2198,29 @@ fun Map?.case_37() { funNullableT() funNullableAny() isEmpty() - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.equals(null) - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.propT - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.propAny - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.propNullableT - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.propNullableAny - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.funT() - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.funAny() - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.funNullableT() - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.funNullableAny() - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.isEmpty() + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.equals(null) + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.propT + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.propAny + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.propNullableT + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.propNullableAny + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.funT() + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.funAny() + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.funNullableT() + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.funNullableAny() + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.isEmpty() } also { - ")!>it - ")!>it.equals(null) - ")!>it.propT - ")!>it.propAny - ")!>it.propNullableT - ")!>it.propNullableAny - ")!>it.funT() - ")!>it.funAny() - ")!>it.funNullableT() - ")!>it.funNullableAny() - ")!>it.isEmpty() + ")!>it + ")!>it.equals(null) + ")!>it.propT + ")!>it.propAny + ")!>it.propNullableT + ")!>it.propNullableAny + ")!>it.funT() + ")!>it.funAny() + ")!>it.funNullableT() + ")!>it.funNullableAny() + ")!>it.isEmpty() } } } @@ -2259,7 +2259,7 @@ fun Map<*, out T>?.case_38() { funNullableAny() isEmpty() apply { - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map<*, T>")!>this equals(null) propT propAny @@ -2270,29 +2270,29 @@ fun Map<*, out T>?.case_38() { funNullableT() funNullableAny() isEmpty() - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.equals(null) - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.propT - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.propAny - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.propNullableT - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.propNullableAny - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.funT() - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.funAny() - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.funNullableT() - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.funNullableAny() - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.isEmpty() + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map<*, T>")!>this.equals(null) + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map<*, T>")!>this.propT + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map<*, T>")!>this.propAny + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map<*, T>")!>this.propNullableT + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map<*, T>")!>this.propNullableAny + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map<*, T>")!>this.funT() + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map<*, T>")!>this.funAny() + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map<*, T>")!>this.funNullableT() + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map<*, T>")!>this.funNullableAny() + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map<*, T>")!>this.isEmpty() } also { - ")!>it - ")!>it.equals(null) - ")!>it.propT - ")!>it.propAny - ")!>it.propNullableT - ")!>it.propNullableAny - ")!>it.funT() - ")!>it.funAny() - ")!>it.funNullableT() - ")!>it.funNullableAny() - ")!>it.isEmpty() + ")!>it + ")!>it.equals(null) + ")!>it.propT + ")!>it.propAny + ")!>it.propNullableT + ")!>it.propNullableAny + ")!>it.funT() + ")!>it.funAny() + ")!>it.funNullableT() + ")!>it.funNullableAny() + ")!>it.isEmpty() } } } @@ -2681,7 +2681,7 @@ fun InterfaceWithFiveTypeParameters1?.case_44() { funNullableAny() itest() apply { - "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this + "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this equals(null) propT propAny @@ -2692,29 +2692,29 @@ fun InterfaceWithFiveTypeParameters1?.case_44() { funNullableT() funNullableAny() itest() - "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.equals(null) - "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.propT - "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.propAny - "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.propNullableT - "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.propNullableAny - "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.funT() - "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.funAny() - "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.funNullableT() - "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.funNullableAny() - "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.itest() + "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.equals(null) + "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.propT + "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.propAny + "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.propNullableT + "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.propNullableAny + "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.funT() + "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.funAny() + "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.funNullableT() + "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.funNullableAny() + "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.itest() } also { - ")!>it - ")!>it.equals(null) - ")!>it.propT - ")!>it.propAny - ")!>it.propNullableT - ")!>it.propNullableAny - ")!>it.funT() - ")!>it.funAny() - ")!>it.funNullableT() - ")!>it.funNullableAny() - ")!>it.itest() + ")!>it + ")!>it.equals(null) + ")!>it.propT + ")!>it.propAny + ")!>it.propNullableT + ")!>it.propNullableAny + ")!>it.funT() + ")!>it.funAny() + ")!>it.funNullableT() + ")!>it.funNullableAny() + ")!>it.itest() } } } @@ -3911,4 +3911,4 @@ fun T.case_65() { } } } -} \ No newline at end of file +} diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/13.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/13.kt index 25c56d0f0af..f074ec8b9ef 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/13.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/13.kt @@ -2135,7 +2135,7 @@ fun case_32(x: Map?) { x.funNullableAny() x.isEmpty() x.apply { - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this equals(null) propT propAny @@ -2146,29 +2146,29 @@ fun case_32(x: Map?) { funNullableT() funNullableAny() isEmpty() - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.equals(null) - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.propT - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.propAny - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.propNullableT - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.propNullableAny - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.funT() - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.funAny() - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.funNullableT() - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.funNullableAny() - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.isEmpty() + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.equals(null) + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.propT + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.propAny + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.propNullableT + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.propNullableAny + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.funT() + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.funAny() + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.funNullableT() + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.funNullableAny() + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.isEmpty() } x.also { - ")!>it - ")!>it.equals(null) - ")!>it.propT - ")!>it.propAny - ")!>it.propNullableT - ")!>it.propNullableAny - ")!>it.funT() - ")!>it.funAny() - ")!>it.funNullableT() - ")!>it.funNullableAny() - ")!>it.isEmpty() + ")!>it + ")!>it.equals(null) + ")!>it.propT + ")!>it.propAny + ")!>it.propNullableT + ")!>it.propNullableAny + ")!>it.funT() + ")!>it.funAny() + ")!>it.funNullableT() + ")!>it.funNullableAny() + ")!>it.isEmpty() } } } @@ -2207,7 +2207,7 @@ fun case_33(x: InterfaceWithFiveTypeParameters1?) { x.funNullableAny() x.itest() x.apply { - "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this + "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this equals(null) propT propAny @@ -2218,29 +2218,29 @@ fun case_33(x: InterfaceWithFiveTypeParameters1?) { funNullableT() funNullableAny() itest() - "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.equals(null) - "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.propT - "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.propAny - "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.propNullableT - "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.propNullableAny - "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.funT() - "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.funAny() - "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.funNullableT() - "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.funNullableAny() - "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.itest() + "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.equals(null) + "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.propT + "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.propAny + "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.propNullableT + "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.propNullableAny + "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.funT() + "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.funAny() + "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.funNullableT() + "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.funNullableAny() + "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.itest() } x.also { - ")!>it - ")!>it.equals(null) - ")!>it.propT - ")!>it.propAny - ")!>it.propNullableT - ")!>it.propNullableAny - ")!>it.funT() - ")!>it.funAny() - ")!>it.funNullableT() - ")!>it.funNullableAny() - ")!>it.itest() + ")!>it + ")!>it.equals(null) + ")!>it.propT + ")!>it.propAny + ")!>it.propNullableT + ")!>it.propNullableAny + ")!>it.funT() + ")!>it.funAny() + ")!>it.funNullableT() + ")!>it.funNullableAny() + ")!>it.itest() } } } @@ -2495,7 +2495,7 @@ fun case_37(x: Map?) { x.funNullableAny() x.isEmpty() x.apply { - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this equals(null) propT propAny @@ -2506,29 +2506,29 @@ fun case_37(x: Map?) { funNullableT() funNullableAny() isEmpty() - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.equals(null) - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.propT - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.propAny - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.propNullableT - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.propNullableAny - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.funT() - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.funAny() - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.funNullableT() - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.funNullableAny() - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.isEmpty() + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.equals(null) + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.propT + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.propAny + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.propNullableT + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.propNullableAny + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.funT() + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.funAny() + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.funNullableT() + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.funNullableAny() + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.isEmpty() } x.also { - ")!>it - ")!>it.equals(null) - ")!>it.propT - ")!>it.propAny - ")!>it.propNullableT - ")!>it.propNullableAny - ")!>it.funT() - ")!>it.funAny() - ")!>it.funNullableT() - ")!>it.funNullableAny() - ")!>it.isEmpty() + ")!>it + ")!>it.equals(null) + ")!>it.propT + ")!>it.propAny + ")!>it.propNullableT + ")!>it.propNullableAny + ")!>it.funT() + ")!>it.funAny() + ")!>it.funNullableT() + ")!>it.funNullableAny() + ")!>it.isEmpty() } } } @@ -2567,7 +2567,7 @@ fun case_38(x: Map<*, out T>?) { x.funNullableAny() x.isEmpty() x.apply { - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map<*, T>")!>this equals(null) propT propAny @@ -2578,29 +2578,29 @@ fun case_38(x: Map<*, out T>?) { funNullableT() funNullableAny() isEmpty() - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.equals(null) - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.propT - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.propAny - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.propNullableT - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.propNullableAny - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.funT() - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.funAny() - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.funNullableT() - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.funNullableAny() - "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map")!>this.isEmpty() + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map<*, T>")!>this.equals(null) + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map<*, T>")!>this.propT + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map<*, T>")!>this.propAny + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map<*, T>")!>this.propNullableT + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map<*, T>")!>this.propNullableAny + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map<*, T>")!>this.funT() + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map<*, T>")!>this.funAny() + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map<*, T>")!>this.funNullableT() + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map<*, T>")!>this.funNullableAny() + "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map<*, T>")!>this.isEmpty() } x.also { - ")!>it - ")!>it.equals(null) - ")!>it.propT - ")!>it.propAny - ")!>it.propNullableT - ")!>it.propNullableAny - ")!>it.funT() - ")!>it.funAny() - ")!>it.funNullableT() - ")!>it.funNullableAny() - ")!>it.isEmpty() + ")!>it + ")!>it.equals(null) + ")!>it.propT + ")!>it.propAny + ")!>it.propNullableT + ")!>it.propNullableAny + ")!>it.funT() + ")!>it.funAny() + ")!>it.funNullableT() + ")!>it.funNullableAny() + ")!>it.isEmpty() } } } @@ -2989,7 +2989,7 @@ fun case_44(x: InterfaceWithFiveTypeParameters1?) { x.funNullableAny() x.itest() x.apply { - "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this + "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this equals(null) propT propAny @@ -3000,29 +3000,29 @@ fun case_44(x: InterfaceWithFiveTypeParameters1?) { funNullableT() funNullableAny() itest() - "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.equals(null) - "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.propT - "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.propAny - "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.propNullableT - "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.propNullableAny - "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.funT() - "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.funAny() - "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.funNullableT() - "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.funNullableAny() - "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.itest() + "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.equals(null) + "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.propT + "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.propAny + "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.propNullableT + "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.propNullableAny + "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.funT() + "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.funAny() + "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.funNullableT() + "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.funNullableAny() + "), DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1")!>this.itest() } x.also { - ")!>it - ")!>it.equals(null) - ")!>it.propT - ")!>it.propAny - ")!>it.propNullableT - ")!>it.propNullableAny - ")!>it.funT() - ")!>it.funAny() - ")!>it.funNullableT() - ")!>it.funNullableAny() - ")!>it.itest() + ")!>it + ")!>it.equals(null) + ")!>it.propT + ")!>it.propAny + ")!>it.propNullableT + ")!>it.propNullableAny + ")!>it.funT() + ")!>it.funAny() + ")!>it.funNullableT() + ")!>it.funNullableAny() + ")!>it.itest() } } } @@ -4364,4 +4364,4 @@ fun case_62(x: T) { it.hashCode() } } -} \ No newline at end of file +} diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/38.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/38.kt index 9e049683f51..6fa9995d6c0 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/38.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/38.kt @@ -27,7 +27,7 @@ fun case_2(x: ClassWithThreeTypeParameters<*, *, *>?) { ? & InterfaceWithTwoTypeParameters<*, *>?")!>x?.x x?.y x?.z - & InterfaceWithTwoTypeParameters}")!>x!!.ip2test() + & InterfaceWithTwoTypeParameters<*, *>}")!>x!!.ip2test() & ClassWithThreeTypeParameters<*, *, *>? & InterfaceWithTwoTypeParameters<*, *>")!>x & ClassWithThreeTypeParameters<*, *, *>? & InterfaceWithTwoTypeParameters<*, *>")!>x.x } @@ -40,7 +40,7 @@ fun case_3(x: ClassWithThreeTypeParameters<*, *, *>) { & InterfaceWithTwoTypeParameters<*, *>")!>x.x x.y x.z - & InterfaceWithTwoTypeParameters}")!>x!!.ip2test() + & InterfaceWithTwoTypeParameters<*, *>}")!>x!!.ip2test() & InterfaceWithTwoTypeParameters<*, *>")!>x & InterfaceWithTwoTypeParameters<*, *>")!>x.x } @@ -54,7 +54,7 @@ fun case_4(x: ClassWithSixTypeParameters<*, *, *, *, *, *>?) { x.y x.z x.u - & InterfaceWithTwoTypeParameters}")!>x!!.ip2test() + & InterfaceWithTwoTypeParameters<*, *>}")!>x!!.ip2test() & ClassWithSixTypeParameters<*, *, *, *, *, *>? & InterfaceWithTwoTypeParameters<*, *>")!>x & ClassWithSixTypeParameters<*, *, *, *, *, *>? & InterfaceWithTwoTypeParameters<*, *>")!>x.x } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/55.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/55.kt index a31bfd36279..e1e7b522508 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/55.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/55.kt @@ -39,7 +39,7 @@ fun case_2(x: Any?) { */ fun case_3(x: Any) { if (x is Map.Entry<*, *>) { - ")!>x!!.key + ")!>x!!.key ")!>x } } @@ -50,7 +50,7 @@ fun case_3(x: Any) { */ fun case_4(x: Any?) { if (x is Map.Entry<*, *>?) { - ")!>x!!.value + ")!>x!!.value ?")!>x } -} \ No newline at end of file +} diff --git a/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java index 87be4d0d269..8812e7edac4 100644 --- a/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java @@ -10010,6 +10010,21 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest { runTest("compiler/testData/diagnostics/tests/inference/reportAboutUnresolvedReferenceAsUnresolved.kt"); } + @TestMetadata("starApproximation.kt") + public void testStarApproximation() throws Exception { + runTest("compiler/testData/diagnostics/tests/inference/starApproximation.kt"); + } + + @TestMetadata("starApproximationBangBang.kt") + public void testStarApproximationBangBang() throws Exception { + runTest("compiler/testData/diagnostics/tests/inference/starApproximationBangBang.kt"); + } + + @TestMetadata("starApproximationFlexible.kt") + public void testStarApproximationFlexible() throws Exception { + runTest("compiler/testData/diagnostics/tests/inference/starApproximationFlexible.kt"); + } + @TestMetadata("tryNumberLowerBoundsBeforeUpperBounds.kt") public void testTryNumberLowerBoundsBeforeUpperBounds() throws Exception { runTest("compiler/testData/diagnostics/tests/inference/tryNumberLowerBoundsBeforeUpperBounds.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsUsingJavacTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsUsingJavacTestGenerated.java index 12540571a6e..35d0c0f418d 100644 --- a/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsUsingJavacTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsUsingJavacTestGenerated.java @@ -10005,6 +10005,21 @@ public class DiagnosticsUsingJavacTestGenerated extends AbstractDiagnosticsUsing runTest("compiler/testData/diagnostics/tests/inference/reportAboutUnresolvedReferenceAsUnresolved.kt"); } + @TestMetadata("starApproximation.kt") + public void testStarApproximation() throws Exception { + runTest("compiler/testData/diagnostics/tests/inference/starApproximation.kt"); + } + + @TestMetadata("starApproximationBangBang.kt") + public void testStarApproximationBangBang() throws Exception { + runTest("compiler/testData/diagnostics/tests/inference/starApproximationBangBang.kt"); + } + + @TestMetadata("starApproximationFlexible.kt") + public void testStarApproximationFlexible() throws Exception { + runTest("compiler/testData/diagnostics/tests/inference/starApproximationFlexible.kt"); + } + @TestMetadata("tryNumberLowerBoundsBeforeUpperBounds.kt") public void testTryNumberLowerBoundsBeforeUpperBounds() throws Exception { runTest("compiler/testData/diagnostics/tests/inference/tryNumberLowerBoundsBeforeUpperBounds.kt");