diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java index 7c0cdae99fa..230559e1301 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java @@ -17231,12 +17231,6 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/functions/functionExpression/functionExpressionWithThisReference.kt"); } - @Test - @TestMetadata("functionExpressionWithThisReferenceNI.kt") - public void testFunctionExpressionWithThisReferenceNI() throws Exception { - runTest("compiler/testData/codegen/box/functions/functionExpression/functionExpressionWithThisReferenceNI.kt"); - } - @Test @TestMetadata("functionLiteralExpression.kt") public void testFunctionLiteralExpression() throws Exception { @@ -23582,12 +23576,6 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/javaInterop/genericSamProjectedOut.kt"); } - @Test - @TestMetadata("genericSamProjectedOutWithNewInference.kt") - public void testGenericSamProjectedOutWithNewInference() throws Exception { - runTest("compiler/testData/codegen/box/javaInterop/genericSamProjectedOutWithNewInference.kt"); - } - @Test @TestMetadata("genericSamSmartcast.kt") public void testGenericSamSmartcast() throws Exception { diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/Fir2IrTextTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/Fir2IrTextTestGenerated.java index fa801eb2498..715edfc9f3e 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/Fir2IrTextTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/Fir2IrTextTestGenerated.java @@ -2177,12 +2177,6 @@ public class Fir2IrTextTestGenerated extends AbstractFir2IrTextTest { runTest("compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.kt"); } - @Test - @TestMetadata("samConversionInGenericConstructorCall_NI.kt") - public void testSamConversionInGenericConstructorCall_NI() throws Exception { - runTest("compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall_NI.kt"); - } - @Test @TestMetadata("samConversionToGeneric.kt") public void testSamConversionToGeneric() throws Exception { @@ -2544,6 +2538,12 @@ public class Fir2IrTextTestGenerated extends AbstractFir2IrTextTest { runTest("compiler/testData/ir/irText/regressions/kt45236.kt"); } + @Test + @TestMetadata("newInferenceFixationOrder1.kt") + public void testNewInferenceFixationOrder1() throws Exception { + runTest("compiler/testData/ir/irText/regressions/newInferenceFixationOrder1.kt"); + } + @Test @TestMetadata("typeAliasCtorForGenericClass.kt") public void testTypeAliasCtorForGenericClass() throws Exception { @@ -2555,22 +2555,6 @@ public class Fir2IrTextTestGenerated extends AbstractFir2IrTextTest { public void testTypeParametersInImplicitCast() throws Exception { runTest("compiler/testData/ir/irText/regressions/typeParametersInImplicitCast.kt"); } - - @Nested - @TestMetadata("compiler/testData/ir/irText/regressions/newInference") - @TestDataPath("$PROJECT_ROOT") - public class NewInference { - @Test - public void testAllFilesPresentInNewInference() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/ir/irText/regressions/newInference"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); - } - - @Test - @TestMetadata("fixationOrder1.kt") - public void testFixationOrder1() throws Exception { - runTest("compiler/testData/ir/irText/regressions/newInference/fixationOrder1.kt"); - } - } } @Nested @@ -2789,39 +2773,21 @@ public class Fir2IrTextTestGenerated extends AbstractFir2IrTextTest { } @Test - @TestMetadata("intersectionType1_NI.kt") - public void testIntersectionType1_NI() throws Exception { - runTest("compiler/testData/ir/irText/types/intersectionType1_NI.kt"); + @TestMetadata("intersectionType1.kt") + public void testIntersectionType1() throws Exception { + runTest("compiler/testData/ir/irText/types/intersectionType1.kt"); } @Test - @TestMetadata("intersectionType1_OI.kt") - public void testIntersectionType1_OI() throws Exception { - runTest("compiler/testData/ir/irText/types/intersectionType1_OI.kt"); + @TestMetadata("intersectionType2.kt") + public void testIntersectionType2() throws Exception { + runTest("compiler/testData/ir/irText/types/intersectionType2.kt"); } @Test - @TestMetadata("intersectionType2_NI.kt") - public void testIntersectionType2_NI() throws Exception { - runTest("compiler/testData/ir/irText/types/intersectionType2_NI.kt"); - } - - @Test - @TestMetadata("intersectionType2_OI.kt") - public void testIntersectionType2_OI() throws Exception { - runTest("compiler/testData/ir/irText/types/intersectionType2_OI.kt"); - } - - @Test - @TestMetadata("intersectionType3_NI.kt") - public void testIntersectionType3_NI() throws Exception { - runTest("compiler/testData/ir/irText/types/intersectionType3_NI.kt"); - } - - @Test - @TestMetadata("intersectionType3_OI.kt") - public void testIntersectionType3_OI() throws Exception { - runTest("compiler/testData/ir/irText/types/intersectionType3_OI.kt"); + @TestMetadata("intersectionType3.kt") + public void testIntersectionType3() throws Exception { + runTest("compiler/testData/ir/irText/types/intersectionType3.kt"); } @Test @@ -2843,9 +2809,9 @@ public class Fir2IrTextTestGenerated extends AbstractFir2IrTextTest { } @Test - @TestMetadata("localVariableOfIntersectionType_NI.kt") - public void testLocalVariableOfIntersectionType_NI() throws Exception { - runTest("compiler/testData/ir/irText/types/localVariableOfIntersectionType_NI.kt"); + @TestMetadata("localVariableOfIntersectionType.kt") + public void testLocalVariableOfIntersectionType() throws Exception { + runTest("compiler/testData/ir/irText/types/localVariableOfIntersectionType.kt"); } @Test @@ -2879,9 +2845,9 @@ public class Fir2IrTextTestGenerated extends AbstractFir2IrTextTest { } @Test - @TestMetadata("starProjection_OI.kt") - public void testStarProjection_OI() throws Exception { - runTest("compiler/testData/ir/irText/types/starProjection_OI.kt"); + @TestMetadata("starProjection.kt") + public void testStarProjection() throws Exception { + runTest("compiler/testData/ir/irText/types/starProjection.kt"); } @Test diff --git a/compiler/testData/codegen/box/callableReference/adaptedReferences/bothWithCoercionToUnit.kt b/compiler/testData/codegen/box/callableReference/adaptedReferences/bothWithCoercionToUnit.kt index e5055ef0295..3f5bec00f96 100644 --- a/compiler/testData/codegen/box/callableReference/adaptedReferences/bothWithCoercionToUnit.kt +++ b/compiler/testData/codegen/box/callableReference/adaptedReferences/bothWithCoercionToUnit.kt @@ -1,5 +1,3 @@ -// !LANGUAGE: +NewInference +FunctionReferenceWithDefaultValueAsOtherType - fun foo(s: String = "kotlin", vararg t: String): Boolean { if (s != "kotlin") throw AssertionError(s) if (t.size != 0) throw AssertionError(t.size.toString()) diff --git a/compiler/testData/codegen/box/callableReference/adaptedReferences/boundReferences.kt b/compiler/testData/codegen/box/callableReference/adaptedReferences/boundReferences.kt index 38689d0fb0e..c1d66b382f7 100644 --- a/compiler/testData/codegen/box/callableReference/adaptedReferences/boundReferences.kt +++ b/compiler/testData/codegen/box/callableReference/adaptedReferences/boundReferences.kt @@ -1,4 +1,3 @@ -// !LANGUAGE: +NewInference +FunctionReferenceWithDefaultValueAsOtherType // WITH_RUNTIME import kotlin.test.assertEquals diff --git a/compiler/testData/codegen/box/callableReference/adaptedReferences/defaultAfterVararg.kt b/compiler/testData/codegen/box/callableReference/adaptedReferences/defaultAfterVararg.kt index 22ef6bfe71f..56f43e1c51e 100644 --- a/compiler/testData/codegen/box/callableReference/adaptedReferences/defaultAfterVararg.kt +++ b/compiler/testData/codegen/box/callableReference/adaptedReferences/defaultAfterVararg.kt @@ -1,5 +1,3 @@ -// !LANGUAGE: +NewInference +FunctionReferenceWithDefaultValueAsOtherType - fun foo(vararg a: String, result: String = "OK"): String = if (a.size == 0) result else "Fail" diff --git a/compiler/testData/codegen/box/callableReference/adaptedReferences/defaultWithGenericExpectedType.kt b/compiler/testData/codegen/box/callableReference/adaptedReferences/defaultWithGenericExpectedType.kt index ee45f6c8e61..627b83762cc 100644 --- a/compiler/testData/codegen/box/callableReference/adaptedReferences/defaultWithGenericExpectedType.kt +++ b/compiler/testData/codegen/box/callableReference/adaptedReferences/defaultWithGenericExpectedType.kt @@ -1,5 +1,3 @@ -// !LANGUAGE: +NewInference +FunctionReferenceWithDefaultValueAsOtherType - fun foo(x: String, y: Char = 'K'): String = x + y fun call(f: (T) -> U, x: T): U = f(x) diff --git a/compiler/testData/codegen/box/callableReference/adaptedReferences/emptyVarargAndDefault.kt b/compiler/testData/codegen/box/callableReference/adaptedReferences/emptyVarargAndDefault.kt index ef0e4d91f74..fb68512ba5d 100644 --- a/compiler/testData/codegen/box/callableReference/adaptedReferences/emptyVarargAndDefault.kt +++ b/compiler/testData/codegen/box/callableReference/adaptedReferences/emptyVarargAndDefault.kt @@ -1,5 +1,3 @@ -// !LANGUAGE: +NewInference +FunctionReferenceWithDefaultValueAsOtherType - fun foo(x: String = "O", vararg y: String): String = if (y.size == 0) x + "K" else "Fail" diff --git a/compiler/testData/codegen/box/callableReference/adaptedReferences/inlineDefault.kt b/compiler/testData/codegen/box/callableReference/adaptedReferences/inlineDefault.kt index 4b0eb9d02bd..f9de9fc1859 100644 --- a/compiler/testData/codegen/box/callableReference/adaptedReferences/inlineDefault.kt +++ b/compiler/testData/codegen/box/callableReference/adaptedReferences/inlineDefault.kt @@ -1,6 +1,5 @@ // IGNORE_BACKEND: WASM // WASM_MUTE_REASON: STDLIB_TEXT -// !LANGUAGE: +NewInference +FunctionReferenceWithDefaultValueAsOtherType // WITH_RUNTIME inline fun foo(mkString: () -> String): String = diff --git a/compiler/testData/codegen/box/callableReference/adaptedReferences/inlineVararg.kt b/compiler/testData/codegen/box/callableReference/adaptedReferences/inlineVararg.kt index fad314cdc26..11b6acdf54c 100644 --- a/compiler/testData/codegen/box/callableReference/adaptedReferences/inlineVararg.kt +++ b/compiler/testData/codegen/box/callableReference/adaptedReferences/inlineVararg.kt @@ -1,6 +1,5 @@ // IGNORE_BACKEND: WASM // WASM_MUTE_REASON: IGNORED_IN_JS -// !LANGUAGE: +NewInference // WITH_RUNTIME inline fun foo(mkString: (Char, Char) -> String): String = @@ -10,4 +9,4 @@ fun bar (vararg xs: Char) = xs.concatToString() fun box(): String = foo(::bar) -// -> { a, b -> bar(a, b) } \ No newline at end of file +// -> { a, b -> bar(a, b) } diff --git a/compiler/testData/codegen/box/callableReference/adaptedReferences/inlineVarargAndDefault.kt b/compiler/testData/codegen/box/callableReference/adaptedReferences/inlineVarargAndDefault.kt index 65265b62c1a..5d1f185ebe8 100644 --- a/compiler/testData/codegen/box/callableReference/adaptedReferences/inlineVarargAndDefault.kt +++ b/compiler/testData/codegen/box/callableReference/adaptedReferences/inlineVarargAndDefault.kt @@ -1,5 +1,3 @@ -// !LANGUAGE: +NewInference +FunctionReferenceWithDefaultValueAsOtherType - fun foo(vararg l: Long, s: String = "OK"): String = if (l.size == 0) s else "Fail" diff --git a/compiler/testData/codegen/box/callableReference/adaptedReferences/inlineVarargInts.kt b/compiler/testData/codegen/box/callableReference/adaptedReferences/inlineVarargInts.kt index 418762a5111..201a5d6574d 100644 --- a/compiler/testData/codegen/box/callableReference/adaptedReferences/inlineVarargInts.kt +++ b/compiler/testData/codegen/box/callableReference/adaptedReferences/inlineVarargInts.kt @@ -1,4 +1,3 @@ -// !LANGUAGE: +NewInference // WITH_RUNTIME inline fun foo(x: (Int, Int) -> Int): Int = diff --git a/compiler/testData/codegen/box/callableReference/adaptedReferences/innerConstructorWithVararg.kt b/compiler/testData/codegen/box/callableReference/adaptedReferences/innerConstructorWithVararg.kt index c44b0def730..d99099cc271 100644 --- a/compiler/testData/codegen/box/callableReference/adaptedReferences/innerConstructorWithVararg.kt +++ b/compiler/testData/codegen/box/callableReference/adaptedReferences/innerConstructorWithVararg.kt @@ -1,6 +1,3 @@ - -// !LANGUAGE: +NewInference +FunctionReferenceWithDefaultValueAsOtherType - class Outer(val o: String) { inner class Inner1(val i: Int, vararg v: String) { val result = "I1" + o + i + if (v.size == 0) "E" else v[0] diff --git a/compiler/testData/codegen/box/callableReference/adaptedReferences/largeVararg.kt b/compiler/testData/codegen/box/callableReference/adaptedReferences/largeVararg.kt index ca32a3a831b..ffb72ad55ca 100644 --- a/compiler/testData/codegen/box/callableReference/adaptedReferences/largeVararg.kt +++ b/compiler/testData/codegen/box/callableReference/adaptedReferences/largeVararg.kt @@ -1,5 +1,3 @@ -// !LANGUAGE: +NewInference - fun foo( f: ( Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, diff --git a/compiler/testData/codegen/box/callableReference/adaptedReferences/localFunctionWithDefault.kt b/compiler/testData/codegen/box/callableReference/adaptedReferences/localFunctionWithDefault.kt index 733f4167d74..3712f1369bc 100644 --- a/compiler/testData/codegen/box/callableReference/adaptedReferences/localFunctionWithDefault.kt +++ b/compiler/testData/codegen/box/callableReference/adaptedReferences/localFunctionWithDefault.kt @@ -1,5 +1,3 @@ -// !LANGUAGE: +NewInference +FunctionReferenceWithDefaultValueAsOtherType - fun call0(f: (String) -> String, x: String): String = f(x) fun call1(f: (String, String) -> String, x: String, y: String): String = f(x, y) fun call2(f: (String, String, String) -> String, x: String, y: String, z: String): String = f(x, y, z) @@ -27,4 +25,4 @@ fun box(): String { val r3 = call2(::bar, "8", "9", "10") if (r3 != "7829") return "FAIL3 $r3" return "OK" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/box/callableReference/adaptedReferences/manyDefaultsAndVararg.kt b/compiler/testData/codegen/box/callableReference/adaptedReferences/manyDefaultsAndVararg.kt index 3c3d4a40b0e..654a4ec6ba3 100644 --- a/compiler/testData/codegen/box/callableReference/adaptedReferences/manyDefaultsAndVararg.kt +++ b/compiler/testData/codegen/box/callableReference/adaptedReferences/manyDefaultsAndVararg.kt @@ -1,4 +1,3 @@ -// !LANGUAGE: +NewInference +FunctionReferenceWithDefaultValueAsOtherType // WITH_RUNTIME import kotlin.test.assertEquals diff --git a/compiler/testData/codegen/box/callableReference/adaptedReferences/simpleDefaultArgument.kt b/compiler/testData/codegen/box/callableReference/adaptedReferences/simpleDefaultArgument.kt index 4e763bea348..aff98a287c2 100644 --- a/compiler/testData/codegen/box/callableReference/adaptedReferences/simpleDefaultArgument.kt +++ b/compiler/testData/codegen/box/callableReference/adaptedReferences/simpleDefaultArgument.kt @@ -1,5 +1,3 @@ -// !LANGUAGE: +NewInference +FunctionReferenceWithDefaultValueAsOtherType - fun foo(x: String, y: String = "K"): String = x + y fun call(f: (String) -> String, x: String): String = f(x) diff --git a/compiler/testData/codegen/box/callableReference/adaptedReferences/simpleEmptyVararg.kt b/compiler/testData/codegen/box/callableReference/adaptedReferences/simpleEmptyVararg.kt index 4855dbc9202..c0f17713054 100644 --- a/compiler/testData/codegen/box/callableReference/adaptedReferences/simpleEmptyVararg.kt +++ b/compiler/testData/codegen/box/callableReference/adaptedReferences/simpleEmptyVararg.kt @@ -1,5 +1,3 @@ -// !LANGUAGE: +NewInference - fun foo(x: String, vararg y: String): String = if (y.size == 0) x + "K" else "Fail" diff --git a/compiler/testData/codegen/box/callableReference/adaptedReferences/unboundReferences.kt b/compiler/testData/codegen/box/callableReference/adaptedReferences/unboundReferences.kt index 35dd9d53e3f..375f2814502 100644 --- a/compiler/testData/codegen/box/callableReference/adaptedReferences/unboundReferences.kt +++ b/compiler/testData/codegen/box/callableReference/adaptedReferences/unboundReferences.kt @@ -1,4 +1,3 @@ -// !LANGUAGE: +NewInference +FunctionReferenceWithDefaultValueAsOtherType // WITH_RUNTIME import kotlin.test.assertEquals diff --git a/compiler/testData/codegen/box/callableReference/adaptedReferences/varargViewedAsPrimitiveArray.kt b/compiler/testData/codegen/box/callableReference/adaptedReferences/varargViewedAsPrimitiveArray.kt index d811287c073..a79a3fdc729 100644 --- a/compiler/testData/codegen/box/callableReference/adaptedReferences/varargViewedAsPrimitiveArray.kt +++ b/compiler/testData/codegen/box/callableReference/adaptedReferences/varargViewedAsPrimitiveArray.kt @@ -1,5 +1,3 @@ -// !LANGUAGE: +NewInference - fun sum(vararg args: Int): Int { var result = 0 for (arg in args) diff --git a/compiler/testData/codegen/box/callableReference/adaptedReferences/varargWithDefaultValue.kt b/compiler/testData/codegen/box/callableReference/adaptedReferences/varargWithDefaultValue.kt index 9cca54c03e7..86869e163fc 100644 --- a/compiler/testData/codegen/box/callableReference/adaptedReferences/varargWithDefaultValue.kt +++ b/compiler/testData/codegen/box/callableReference/adaptedReferences/varargWithDefaultValue.kt @@ -1,5 +1,3 @@ -// !LANGUAGE: +NewInference +FunctionReferenceWithDefaultValueAsOtherType - fun foo(x: Int, s: Int, vararg y: CharSequence = arrayOf("Aaa")): String = if (y.size == s && y[0].length == x) "OK" else "Fail" diff --git a/compiler/testData/codegen/box/callableReference/bound/boundReferenceToOverloadedFunction.kt b/compiler/testData/codegen/box/callableReference/bound/boundReferenceToOverloadedFunction.kt index 7a832aa9cc7..d4d217bc891 100644 --- a/compiler/testData/codegen/box/callableReference/bound/boundReferenceToOverloadedFunction.kt +++ b/compiler/testData/codegen/box/callableReference/bound/boundReferenceToOverloadedFunction.kt @@ -1,6 +1,3 @@ - -// !LANGUAGE: +NewInference - interface JsonParser interface JsonCodingParser : JsonParser @@ -23,4 +20,4 @@ class Test { fun box(): String { Test().fooTest() return result -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/box/callableReference/bound/coercionToUnit.kt b/compiler/testData/codegen/box/callableReference/bound/coercionToUnit.kt index a0162da9e86..b7b997f6f40 100644 --- a/compiler/testData/codegen/box/callableReference/bound/coercionToUnit.kt +++ b/compiler/testData/codegen/box/callableReference/bound/coercionToUnit.kt @@ -1,5 +1,3 @@ - -// !LANGUAGE: +NewInference // WITH_RUNTIME class Foo diff --git a/compiler/testData/codegen/box/callableReference/bound/referenceToGetSetMethodsFromVararg.kt b/compiler/testData/codegen/box/callableReference/bound/referenceToGetSetMethodsFromVararg.kt index b0b95948c4e..30277a36683 100644 --- a/compiler/testData/codegen/box/callableReference/bound/referenceToGetSetMethodsFromVararg.kt +++ b/compiler/testData/codegen/box/callableReference/bound/referenceToGetSetMethodsFromVararg.kt @@ -1,4 +1,3 @@ -// !LANGUAGE: +NewInference // TARGET_BACKEND: JVM // WITH_REFLECT diff --git a/compiler/testData/codegen/box/callableReference/function/coercionToUnit.kt b/compiler/testData/codegen/box/callableReference/function/coercionToUnit.kt index 299413f7a2a..de5ff846fa1 100644 --- a/compiler/testData/codegen/box/callableReference/function/coercionToUnit.kt +++ b/compiler/testData/codegen/box/callableReference/function/coercionToUnit.kt @@ -1,5 +1,3 @@ -// !LANGUAGE: +NewInference - fun foo(s: String): Boolean { if (s != "kotlin") throw AssertionError(s) return true diff --git a/compiler/testData/codegen/box/callableReference/function/kt32462.kt b/compiler/testData/codegen/box/callableReference/function/kt32462.kt index 34c3e3823e5..5594dbe12ed 100644 --- a/compiler/testData/codegen/box/callableReference/function/kt32462.kt +++ b/compiler/testData/codegen/box/callableReference/function/kt32462.kt @@ -1,4 +1,3 @@ -// !LANGUAGE: +NewInference // WITH_RUNTIME // ISSUE: KT-32462 diff --git a/compiler/testData/codegen/box/closures/anonymousObjectAsLastExpressionInLambda.kt b/compiler/testData/codegen/box/closures/anonymousObjectAsLastExpressionInLambda.kt index de66262405b..0ef89aa4bd0 100644 --- a/compiler/testData/codegen/box/closures/anonymousObjectAsLastExpressionInLambda.kt +++ b/compiler/testData/codegen/box/closures/anonymousObjectAsLastExpressionInLambda.kt @@ -1,4 +1,3 @@ -// !LANGUAGE: +NewInference // WITH_RUNTIME object A { diff --git a/compiler/testData/codegen/box/compileKotlinAgainstKotlin/useDeserializedFunInterface.kt b/compiler/testData/codegen/box/compileKotlinAgainstKotlin/useDeserializedFunInterface.kt index 335d155a2ee..bde720a9df1 100644 --- a/compiler/testData/codegen/box/compileKotlinAgainstKotlin/useDeserializedFunInterface.kt +++ b/compiler/testData/codegen/box/compileKotlinAgainstKotlin/useDeserializedFunInterface.kt @@ -1,5 +1,3 @@ -// !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions - // MODULE: lib // FILE: A.kt diff --git a/compiler/testData/codegen/box/controlStructures/tryFinallyGeneric.kt b/compiler/testData/codegen/box/controlStructures/tryFinallyGeneric.kt index e65514bbf82..5a077cb3bc1 100644 --- a/compiler/testData/codegen/box/controlStructures/tryFinallyGeneric.kt +++ b/compiler/testData/codegen/box/controlStructures/tryFinallyGeneric.kt @@ -1,6 +1,5 @@ // TARGET_BACKEND: JVM // WITH_RUNTIME -// !LANGUAGE: +NewInference val stack = mutableListOf() @@ -22,4 +21,4 @@ fun box(): String { } else { return "OK" } -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/box/coroutines/kt30858.kt b/compiler/testData/codegen/box/coroutines/kt30858.kt index 591d086467f..eb8a63c45e8 100644 --- a/compiler/testData/codegen/box/coroutines/kt30858.kt +++ b/compiler/testData/codegen/box/coroutines/kt30858.kt @@ -1,4 +1,3 @@ -// !LANGUAGE: +NewInference // IGNORE_BACKEND: NATIVE // WITH_RUNTIME // WITH_COROUTINES @@ -33,4 +32,4 @@ fun box(): String { m.debounce(42) return "OK" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/box/coroutines/kt31784.kt b/compiler/testData/codegen/box/coroutines/kt31784.kt index cfd75d5adb0..3b52e4b2308 100644 --- a/compiler/testData/codegen/box/coroutines/kt31784.kt +++ b/compiler/testData/codegen/box/coroutines/kt31784.kt @@ -1,4 +1,3 @@ -// !LANGUAGE: +NewInference // WITH_RUNTIME @file:OptIn(ExperimentalTypeInference::class) @@ -31,4 +30,4 @@ fun box(): String { } return if (r == 42) "OK" else "Fail: $r" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/box/coroutines/kt35967.kt b/compiler/testData/codegen/box/coroutines/kt35967.kt index 1d4b42a0eab..b55cd743813 100644 --- a/compiler/testData/codegen/box/coroutines/kt35967.kt +++ b/compiler/testData/codegen/box/coroutines/kt35967.kt @@ -1,4 +1,3 @@ -// !LANGUAGE: +NewInference // WITH_RUNTIME // FULL_JDK // ISSUE: KT-35967 diff --git a/compiler/testData/codegen/box/coroutines/tailCallOptimizations/unit/functionReference.kt b/compiler/testData/codegen/box/coroutines/tailCallOptimizations/unit/functionReference.kt index 20f288ece54..3b88b3b0d9a 100644 --- a/compiler/testData/codegen/box/coroutines/tailCallOptimizations/unit/functionReference.kt +++ b/compiler/testData/codegen/box/coroutines/tailCallOptimizations/unit/functionReference.kt @@ -1,4 +1,3 @@ -// !LANGUAGE: +NewInference // TARGET_BACKEND: JVM // WITH_RUNTIME // WITH_COROUTINES diff --git a/compiler/testData/codegen/box/defaultArguments/referenceAsArg.kt b/compiler/testData/codegen/box/defaultArguments/referenceAsArg.kt index e3a5d011077..91f8e9bf22c 100644 --- a/compiler/testData/codegen/box/defaultArguments/referenceAsArg.kt +++ b/compiler/testData/codegen/box/defaultArguments/referenceAsArg.kt @@ -1,5 +1,3 @@ -// !LANGUAGE: +NewInference +FunctionReferenceWithDefaultValueAsOtherType - inline fun String.app(f: (String) -> String) = f(this) fun fff(s: String, n: Int = 42) = s diff --git a/compiler/testData/codegen/box/delegatedProperty/kt35707.kt b/compiler/testData/codegen/box/delegatedProperty/kt35707.kt index f749a7f485c..643657e36b6 100644 --- a/compiler/testData/codegen/box/delegatedProperty/kt35707.kt +++ b/compiler/testData/codegen/box/delegatedProperty/kt35707.kt @@ -1,4 +1,3 @@ -// !LANGUAGE: +NewInference // ISSUE: KT-35707 import kotlin.reflect.KProperty @@ -17,4 +16,4 @@ fun box(): String { } else { "FAIL" } -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/box/delegatedProperty/optimizedDelegatedProperties/mixedArgumentSizes.kt b/compiler/testData/codegen/box/delegatedProperty/optimizedDelegatedProperties/mixedArgumentSizes.kt index 5baa4cf3330..23be2f3d0c8 100644 --- a/compiler/testData/codegen/box/delegatedProperty/optimizedDelegatedProperties/mixedArgumentSizes.kt +++ b/compiler/testData/codegen/box/delegatedProperty/optimizedDelegatedProperties/mixedArgumentSizes.kt @@ -1,5 +1,3 @@ -// !LANGUAGE: -NewInference - inline operator fun Double.provideDelegate(thisRef: Any?, kProp: Any?) = this.toLong() inline operator fun Long.getValue(thisRef: Any?, kProp: Any?) = this.toInt() diff --git a/compiler/testData/codegen/box/delegatedProperty/provideDelegate/genericProvideDelegateOnNumberLiteral.kt b/compiler/testData/codegen/box/delegatedProperty/provideDelegate/genericProvideDelegateOnNumberLiteral.kt index 42df13c19cb..12008f2d43f 100644 --- a/compiler/testData/codegen/box/delegatedProperty/provideDelegate/genericProvideDelegateOnNumberLiteral.kt +++ b/compiler/testData/codegen/box/delegatedProperty/provideDelegate/genericProvideDelegateOnNumberLiteral.kt @@ -1,4 +1,3 @@ -// !LANGUAGE: +NewInference // WITH_RUNTIME import kotlin.properties.ReadOnlyProperty @@ -26,4 +25,4 @@ fun box(): String { if (byStringNullable != "strNullable") return "fail5" return "OK" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/box/elvis/genericElvisWithMoreSpecificLHS.kt b/compiler/testData/codegen/box/elvis/genericElvisWithMoreSpecificLHS.kt index 13b823a6b75..ad6c89f9cad 100644 --- a/compiler/testData/codegen/box/elvis/genericElvisWithMoreSpecificLHS.kt +++ b/compiler/testData/codegen/box/elvis/genericElvisWithMoreSpecificLHS.kt @@ -1,4 +1,3 @@ -// !LANGUAGE: +NewInference // WITH_RUNTIME fun test(foo: MutableList?): List { @@ -14,4 +13,4 @@ fun box(): String { if (b.size != 1) return "Fail 2" return "OK" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/box/fullJdk/kt31757.kt b/compiler/testData/codegen/box/fullJdk/kt31757.kt index c3cde0c8023..3da0457a432 100644 --- a/compiler/testData/codegen/box/fullJdk/kt31757.kt +++ b/compiler/testData/codegen/box/fullJdk/kt31757.kt @@ -1,4 +1,3 @@ -// !LANGUAGE: +NewInference // TARGET_BACKEND: JVM // SKIP_JDK6 // FULL_JDK diff --git a/compiler/testData/codegen/box/funInterface/basicFunInterfaceConversion.kt b/compiler/testData/codegen/box/funInterface/basicFunInterfaceConversion.kt index b13d2bb2e25..6bfc99a1109 100644 --- a/compiler/testData/codegen/box/funInterface/basicFunInterfaceConversion.kt +++ b/compiler/testData/codegen/box/funInterface/basicFunInterfaceConversion.kt @@ -1,5 +1,3 @@ -// !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions - fun interface Foo { fun invoke(): String } @@ -8,4 +6,4 @@ fun foo(f: Foo) = f.invoke() fun box(): String { return foo { "OK" } -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/box/funInterface/basicFunInterfaceConversionClash.kt b/compiler/testData/codegen/box/funInterface/basicFunInterfaceConversionClash.kt index ea1368517af..7efdfd5c52a 100644 --- a/compiler/testData/codegen/box/funInterface/basicFunInterfaceConversionClash.kt +++ b/compiler/testData/codegen/box/funInterface/basicFunInterfaceConversionClash.kt @@ -1,5 +1,3 @@ -// !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions - // FILE: lib.kt fun interface Foo { @@ -26,4 +24,4 @@ inline fun bar2(): String { // FILE: main.kt -fun box(): String = bar1() + bar2() \ No newline at end of file +fun box(): String = bar1() + bar2() diff --git a/compiler/testData/codegen/box/funInterface/castFromAny.kt b/compiler/testData/codegen/box/funInterface/castFromAny.kt index 51db56520e0..e731470f01f 100644 --- a/compiler/testData/codegen/box/funInterface/castFromAny.kt +++ b/compiler/testData/codegen/box/funInterface/castFromAny.kt @@ -1,6 +1,3 @@ -// !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions - - fun interface KRunnable { fun invoke() } diff --git a/compiler/testData/codegen/box/funInterface/funConversionInVararg.kt b/compiler/testData/codegen/box/funInterface/funConversionInVararg.kt index 5dc007dbd2b..e10a1a07e1b 100644 --- a/compiler/testData/codegen/box/funInterface/funConversionInVararg.kt +++ b/compiler/testData/codegen/box/funInterface/funConversionInVararg.kt @@ -1,5 +1,3 @@ -// !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument - fun interface MyRunnable { fun run() } diff --git a/compiler/testData/codegen/box/funInterface/funInterfaceInheritance.kt b/compiler/testData/codegen/box/funInterface/funInterfaceInheritance.kt index 81a3e135b25..302cd28f8de 100644 --- a/compiler/testData/codegen/box/funInterface/funInterfaceInheritance.kt +++ b/compiler/testData/codegen/box/funInterface/funInterfaceInheritance.kt @@ -1,5 +1,3 @@ -// !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions - fun interface Base { fun doStuff(): String } @@ -26,4 +24,4 @@ fun box(): String { if (runProxy { 10 } != "10") return "fail2" return runBase { "OK" } -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/box/funInterface/inlinedSamWrapper.kt b/compiler/testData/codegen/box/funInterface/inlinedSamWrapper.kt index 30e520ea6dc..db65c0faa71 100644 --- a/compiler/testData/codegen/box/funInterface/inlinedSamWrapper.kt +++ b/compiler/testData/codegen/box/funInterface/inlinedSamWrapper.kt @@ -1,4 +1,3 @@ -// !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions // WITH_RUNTIME fun interface MyRunnable { diff --git a/compiler/testData/codegen/box/funInterface/multimodule.kt b/compiler/testData/codegen/box/funInterface/multimodule.kt index 764eb3d1e68..c0e8a039714 100644 --- a/compiler/testData/codegen/box/funInterface/multimodule.kt +++ b/compiler/testData/codegen/box/funInterface/multimodule.kt @@ -1,5 +1,3 @@ -// !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions - // MODULE: m1 // FILE: m1.kt @@ -42,4 +40,4 @@ fun box(): String { if (rn2Inline { "inline" } != "inline") return "fail 4" return rn2 { "OK" } -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/box/funInterface/nullableSam.kt b/compiler/testData/codegen/box/funInterface/nullableSam.kt index ce5456238ab..bebc29123bd 100644 --- a/compiler/testData/codegen/box/funInterface/nullableSam.kt +++ b/compiler/testData/codegen/box/funInterface/nullableSam.kt @@ -1,4 +1,3 @@ -// !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions // WITH_RUNTIME fun interface KRunnable { diff --git a/compiler/testData/codegen/box/funInterface/partialSam.kt b/compiler/testData/codegen/box/funInterface/partialSam.kt index f33c10526c2..7703365d35b 100644 --- a/compiler/testData/codegen/box/funInterface/partialSam.kt +++ b/compiler/testData/codegen/box/funInterface/partialSam.kt @@ -1,4 +1,3 @@ -// !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions // WITH_RUNTIME fun interface Fn { @@ -38,4 +37,4 @@ fun box(): String { if (x != "LFoo42239 Bar1LFoo Foo42239 LBar1Foo") return x return "OK" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/box/funInterface/primitiveConversions.kt b/compiler/testData/codegen/box/funInterface/primitiveConversions.kt index 5ef596ad9d8..f3a7210b08b 100644 --- a/compiler/testData/codegen/box/funInterface/primitiveConversions.kt +++ b/compiler/testData/codegen/box/funInterface/primitiveConversions.kt @@ -1,5 +1,3 @@ -// !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions - // This test should check argument coercion between the SAM and the lambda. // For now it checks that Char is boxed in JS @@ -40,4 +38,4 @@ fun box(): String { if (c6 !is Char || c6 != '6') return "fail6" return "OK" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/box/funInterface/receiverEvaluatedOnce.kt b/compiler/testData/codegen/box/funInterface/receiverEvaluatedOnce.kt index d23a0636950..a7965803cc3 100644 --- a/compiler/testData/codegen/box/funInterface/receiverEvaluatedOnce.kt +++ b/compiler/testData/codegen/box/funInterface/receiverEvaluatedOnce.kt @@ -1,4 +1,3 @@ -// !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions // WITH_RUNTIME fun interface KRunnable { diff --git a/compiler/testData/codegen/box/funInterface/suspendFunInterfaceConversionCodegen.kt b/compiler/testData/codegen/box/funInterface/suspendFunInterfaceConversionCodegen.kt index 1d57b759264..985e477e144 100644 --- a/compiler/testData/codegen/box/funInterface/suspendFunInterfaceConversionCodegen.kt +++ b/compiler/testData/codegen/box/funInterface/suspendFunInterfaceConversionCodegen.kt @@ -1,4 +1,3 @@ -// !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions // WITH_COROUTINES // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/functions/functionExpression/functionExpressionWithThisReference.kt b/compiler/testData/codegen/box/functions/functionExpression/functionExpressionWithThisReference.kt index a9e1d43173e..736130bbc0f 100644 --- a/compiler/testData/codegen/box/functions/functionExpression/functionExpressionWithThisReference.kt +++ b/compiler/testData/codegen/box/functions/functionExpression/functionExpressionWithThisReference.kt @@ -1,4 +1,3 @@ - fun Int.thisRef1() = fun () = this fun Int.thisRef2() = fun (): Int {return this} @@ -31,4 +30,4 @@ fun box(): String { if ("bar".withLabel2() != "bar") return "Test 10 failed" return "OK" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/box/functions/functionExpression/functionExpressionWithThisReferenceNI.kt b/compiler/testData/codegen/box/functions/functionExpression/functionExpressionWithThisReferenceNI.kt deleted file mode 100644 index f44e247af37..00000000000 --- a/compiler/testData/codegen/box/functions/functionExpression/functionExpressionWithThisReferenceNI.kt +++ /dev/null @@ -1,36 +0,0 @@ -// !LANGUAGE: +NewInference -// NewInference needed because of KT-26531 - -fun Int.thisRef1() = fun () = this -fun Int.thisRef2() = fun (): Int {return this} - -fun T.genericThisRef1() = fun () = this -fun T.genericThisRef2() = fun (): T {return this} - -val Int.valThisRef1: () -> Int get() = fun () = this -val Int.valThisRef2: () -> Int get() = fun (): Int {return this} - -val T.valGenericThisRef1: ()->T get() = fun () = this -val T.valGenericThisRef2: ()->T get() = fun (): T {return this} - -val T.withLabel1: ()->T get() = fun () = this@withLabel1 -val T.withLabel2: ()->T get() = fun (): T {return this@withLabel2} - -fun box(): String { - if (1.thisRef1()() != 1) return "Test 1 failed" - if (2.thisRef2()() != 2) return "Test 2 failed" - - if (3.genericThisRef1()() != 3) return "Test 3 failed" - if (4.genericThisRef2()() != 4) return "Test 4 failed" - - if (5.valThisRef1() != 5) return "Test 5 failed" - if (6.valThisRef2() != 6) return "Test 6 failed" - - if (7.valGenericThisRef1() != 7) return "Test 7 failed" - if (8.valGenericThisRef2() != 8) return "Test 8 failed" - - if ("bar".withLabel1() != "bar") return "Test 9 failed" - if ("bar".withLabel2() != "bar") return "Test 10 failed" - - return "OK" -} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ieee754/lessDouble_properIeeeAndNewInference.kt b/compiler/testData/codegen/box/ieee754/lessDouble_properIeeeAndNewInference.kt index d5f0f13e4ba..873cea37001 100644 --- a/compiler/testData/codegen/box/ieee754/lessDouble_properIeeeAndNewInference.kt +++ b/compiler/testData/codegen/box/ieee754/lessDouble_properIeeeAndNewInference.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +ProperIeee754Comparisons +NewInference +// !LANGUAGE: +ProperIeee754Comparisons fun box(): String { if (-0.0 < 0.0) return "Fail 1" diff --git a/compiler/testData/codegen/box/inference/builderInference.kt b/compiler/testData/codegen/box/inference/builderInference.kt index bdcc0a56bea..cb7d1a6365a 100644 --- a/compiler/testData/codegen/box/inference/builderInference.kt +++ b/compiler/testData/codegen/box/inference/builderInference.kt @@ -1,6 +1,5 @@ // TARGET_BACKEND: JVM // WITH_RUNTIME -// !LANGUAGE: +NewInference // ISSUE: KT-33545 import kotlin.experimental.ExperimentalTypeInference @@ -29,4 +28,4 @@ fun Flow.asLiveData() = liveData { // collect { emit(it) } } -fun box(): String = "OK" \ No newline at end of file +fun box(): String = "OK" diff --git a/compiler/testData/codegen/box/inference/builderInference/callableReferenceAndCoercionToUnit.kt b/compiler/testData/codegen/box/inference/builderInference/callableReferenceAndCoercionToUnit.kt index 81f8401c34c..1c041b169c1 100644 --- a/compiler/testData/codegen/box/inference/builderInference/callableReferenceAndCoercionToUnit.kt +++ b/compiler/testData/codegen/box/inference/builderInference/callableReferenceAndCoercionToUnit.kt @@ -1,4 +1,3 @@ -// !LANGUAGE: +NewInference // !DIAGNOSTICS: -OPT_IN_USAGE_ERROR -UNUSED_EXPRESSION // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/inference/builderInference/lackOfNullCheckOnNullableInsideBuild.kt b/compiler/testData/codegen/box/inference/builderInference/lackOfNullCheckOnNullableInsideBuild.kt index 6dc61506d08..5d83c7f839f 100644 --- a/compiler/testData/codegen/box/inference/builderInference/lackOfNullCheckOnNullableInsideBuild.kt +++ b/compiler/testData/codegen/box/inference/builderInference/lackOfNullCheckOnNullableInsideBuild.kt @@ -1,4 +1,3 @@ -// !LANGUAGE: +NewInference // WITH_RUNTIME // Issue: KT-36371 diff --git a/compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferencesNonStrictOnlyInputTypes.kt b/compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferencesNonStrictOnlyInputTypes.kt index bf876165615..05f00aec992 100644 --- a/compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferencesNonStrictOnlyInputTypes.kt +++ b/compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferencesNonStrictOnlyInputTypes.kt @@ -1,4 +1,3 @@ -// !LANGUAGE: +NewInference // WITH_RUNTIME // TARGET_BACKEND: JVM // IGNORE_BACKEND: WASM @@ -24,4 +23,4 @@ interface Flow interface FlowCollector -fun box() = "OK" \ No newline at end of file +fun box() = "OK" diff --git a/compiler/testData/codegen/box/inference/builderInferenceLeakingVariable.kt b/compiler/testData/codegen/box/inference/builderInferenceLeakingVariable.kt index 60074d829aa..48fee22e526 100644 --- a/compiler/testData/codegen/box/inference/builderInferenceLeakingVariable.kt +++ b/compiler/testData/codegen/box/inference/builderInferenceLeakingVariable.kt @@ -1,6 +1,5 @@ // Issues: KT-33542, KT-33544 // WITH_RUNTIME -// !LANGUAGE: +NewInference import kotlin.experimental.ExperimentalTypeInference diff --git a/compiler/testData/codegen/box/inference/capturedStarProjection.kt b/compiler/testData/codegen/box/inference/capturedStarProjection.kt index fc9c5ffbfd4..67815bc89d3 100644 --- a/compiler/testData/codegen/box/inference/capturedStarProjection.kt +++ b/compiler/testData/codegen/box/inference/capturedStarProjection.kt @@ -1,4 +1,3 @@ -// !LANGUAGE: +NewInference // WITH_RUNTIME interface A { @@ -11,4 +10,4 @@ fun test(a: A<*>) { fun box(): String { return "OK" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/box/inference/integerLiteralTypeInLamdaReturnType.kt b/compiler/testData/codegen/box/inference/integerLiteralTypeInLamdaReturnType.kt index cd7ef968994..54d99c23562 100644 --- a/compiler/testData/codegen/box/inference/integerLiteralTypeInLamdaReturnType.kt +++ b/compiler/testData/codegen/box/inference/integerLiteralTypeInLamdaReturnType.kt @@ -1,4 +1,3 @@ -// !LANGUAGE: +NewInference // WITH_RUNTIME // SKIP_DCE_DRIVEN @@ -15,4 +14,4 @@ fun box(): String { val sorted = foo.test(list) return list.first() -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/box/inference/kt32429.kt b/compiler/testData/codegen/box/inference/kt32429.kt index 1ea97aa7365..ed1a7432752 100644 --- a/compiler/testData/codegen/box/inference/kt32429.kt +++ b/compiler/testData/codegen/box/inference/kt32429.kt @@ -1,6 +1,5 @@ // TARGET_BACKEND: JVM // WITH_RUNTIME -// !LANGUAGE: +NewInference // ISSUE: KT-32429 import kotlin.properties.Delegates.observable diff --git a/compiler/testData/codegen/box/inference/kt35684.kt b/compiler/testData/codegen/box/inference/kt35684.kt index 0cb98a66d87..9ee703bf90e 100644 --- a/compiler/testData/codegen/box/inference/kt35684.kt +++ b/compiler/testData/codegen/box/inference/kt35684.kt @@ -1,4 +1,3 @@ -// !LANGUAGE: +NewInference // !OPT_IN: kotlin.RequiresOptIn // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/inference/kt36446.kt b/compiler/testData/codegen/box/inference/kt36446.kt index 09d12eaaacd..e8efa3acbf0 100644 --- a/compiler/testData/codegen/box/inference/kt36446.kt +++ b/compiler/testData/codegen/box/inference/kt36446.kt @@ -1,4 +1,3 @@ -// !LANGUAGE: +NewInference // WITH_RUNTIME // WITH_REFLECT diff --git a/compiler/testData/codegen/box/inference/lastExpressionOfLambdaWithNothingConstraint.kt b/compiler/testData/codegen/box/inference/lastExpressionOfLambdaWithNothingConstraint.kt index 9f15e1dba03..c8ea28d58fa 100644 --- a/compiler/testData/codegen/box/inference/lastExpressionOfLambdaWithNothingConstraint.kt +++ b/compiler/testData/codegen/box/inference/lastExpressionOfLambdaWithNothingConstraint.kt @@ -1,4 +1,3 @@ -// !LANGUAGE: +NewInference // WITH_RUNTIME inline fun foo(f: () -> T): String { @@ -27,4 +26,4 @@ fun test(b: Boolean): String { fun box(): String { return test(true) -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/box/inference/suspendExtensionRecevierFromConstraint.kt b/compiler/testData/codegen/box/inference/suspendExtensionRecevierFromConstraint.kt index 6169262e158..9c7ffb8cb65 100644 --- a/compiler/testData/codegen/box/inference/suspendExtensionRecevierFromConstraint.kt +++ b/compiler/testData/codegen/box/inference/suspendExtensionRecevierFromConstraint.kt @@ -1,5 +1,4 @@ // WITH_RUNTIME -// !LANGUAGE: +NewInference class ExtensionReceiver typealias SuspendExtensionFunction = suspend ExtensionReceiver.() -> Unit diff --git a/compiler/testData/codegen/box/javaInterop/genericSamProjectedOut.kt b/compiler/testData/codegen/box/javaInterop/genericSamProjectedOut.kt index dcf71a64e16..5584c00ffc0 100644 --- a/compiler/testData/codegen/box/javaInterop/genericSamProjectedOut.kt +++ b/compiler/testData/codegen/box/javaInterop/genericSamProjectedOut.kt @@ -1,7 +1,6 @@ -// !LANGUAGE: -NewInference // TARGET_BACKEND: JVM -// WITH_RUNTIME // FILE: example/Hello.java + package example; @FunctionalInterface @@ -17,27 +16,28 @@ public class SomeJavaClass { ((Hello)hello).invoke("OK"); } - public void plus(Hello hello) { + public SomeJavaClass plus(Hello hello) { ((Hello)hello).invoke("OK"); + return this; } public void get(Hello hello) { ((Hello)hello).invoke("OK"); } + + public void set(int i, Hello hello) { + ((Hello)hello).invoke("OK"); + } } // FILE: main.kt import example.SomeJavaClass fun box(): String { - val a: SomeJavaClass = SomeJavaClass() + var a: SomeJavaClass = SomeJavaClass() var result = "fail" - // a::someFunction parameter has type of Nothing - // while it's completely safe to pass a lambda for a SAM - // since Hello is effectively contravariant by its parameter - // NB: this ^ is not supported by FIR yet a.someFunction { result = it } @@ -58,5 +58,19 @@ fun box(): String { if (result != "OK") return "fail 3: $result" + result = "fail" + + a += { + result = it + } + + if (result != "OK") return "fail 4: $result" + + result = "fail" + + a[0] = { result = it } + + if (result != "OK") return "fail 5: $result" + return "OK" } diff --git a/compiler/testData/codegen/box/javaInterop/genericSamProjectedOutWithNewInference.kt b/compiler/testData/codegen/box/javaInterop/genericSamProjectedOutWithNewInference.kt deleted file mode 100644 index 5584c00ffc0..00000000000 --- a/compiler/testData/codegen/box/javaInterop/genericSamProjectedOutWithNewInference.kt +++ /dev/null @@ -1,76 +0,0 @@ -// TARGET_BACKEND: JVM -// FILE: example/Hello.java - -package example; - -@FunctionalInterface -public interface Hello { - void invoke(A a); -} - -// FILE: example/SomeJavaClass.java -package example; - -public class SomeJavaClass { - public void someFunction(Hello hello) { - ((Hello)hello).invoke("OK"); - } - - public SomeJavaClass plus(Hello hello) { - ((Hello)hello).invoke("OK"); - return this; - } - - public void get(Hello hello) { - ((Hello)hello).invoke("OK"); - } - - public void set(int i, Hello hello) { - ((Hello)hello).invoke("OK"); - } -} - -// FILE: main.kt -import example.SomeJavaClass - -fun box(): String { - var a: SomeJavaClass = SomeJavaClass() - - var result = "fail" - - a.someFunction { - result = it - } - - if (result != "OK") return "fail 1: $result" - result = "fail" - - a + { - result = it - } - - if (result != "OK") return "fail 2: $result" - result = "fail" - - a[{ - result = it - }] - - if (result != "OK") return "fail 3: $result" - - result = "fail" - - a += { - result = it - } - - if (result != "OK") return "fail 4: $result" - - result = "fail" - - a[0] = { result = it } - - if (result != "OK") return "fail 5: $result" - - return "OK" -} diff --git a/compiler/testData/codegen/box/javaInterop/generics/javaNestedSamInterface.kt b/compiler/testData/codegen/box/javaInterop/generics/javaNestedSamInterface.kt index cf00a01d59e..2441d1be871 100644 --- a/compiler/testData/codegen/box/javaInterop/generics/javaNestedSamInterface.kt +++ b/compiler/testData/codegen/box/javaInterop/generics/javaNestedSamInterface.kt @@ -1,4 +1,3 @@ -// !LANGUAGE: +NewInference // TARGET_BACKEND: JVM // FILE: javaNestedSamInterface.kt import test.A diff --git a/compiler/testData/codegen/box/mixedNamedPosition/defaults.kt b/compiler/testData/codegen/box/mixedNamedPosition/defaults.kt index 2e9f155f135..4ee7c5dad33 100644 --- a/compiler/testData/codegen/box/mixedNamedPosition/defaults.kt +++ b/compiler/testData/codegen/box/mixedNamedPosition/defaults.kt @@ -1,5 +1,3 @@ -// !LANGUAGE: +NewInference +MixedNamedArgumentsInTheirOwnPosition - fun foo( p1: Int = 1, p2: String = "2", diff --git a/compiler/testData/codegen/box/mixedNamedPosition/simple.kt b/compiler/testData/codegen/box/mixedNamedPosition/simple.kt index d036eb4c1cc..eec1232fbda 100644 --- a/compiler/testData/codegen/box/mixedNamedPosition/simple.kt +++ b/compiler/testData/codegen/box/mixedNamedPosition/simple.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +NewInference +MixedNamedArgumentsInTheirOwnPosition +// !LANGUAGE: +MixedNamedArgumentsInTheirOwnPosition fun foo( p1: Int, diff --git a/compiler/testData/codegen/box/mixedNamedPosition/varargs.kt b/compiler/testData/codegen/box/mixedNamedPosition/varargs.kt index e680a11a175..08c7725871a 100644 --- a/compiler/testData/codegen/box/mixedNamedPosition/varargs.kt +++ b/compiler/testData/codegen/box/mixedNamedPosition/varargs.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +NewInference +MixedNamedArgumentsInTheirOwnPosition +// !LANGUAGE: +MixedNamedArgumentsInTheirOwnPosition fun foo1( vararg p1: Int, diff --git a/compiler/testData/codegen/box/mixedNamedPosition/varargsEvaluationOrder.kt b/compiler/testData/codegen/box/mixedNamedPosition/varargsEvaluationOrder.kt index 3f2298d62d3..9568907aad6 100644 --- a/compiler/testData/codegen/box/mixedNamedPosition/varargsEvaluationOrder.kt +++ b/compiler/testData/codegen/box/mixedNamedPosition/varargsEvaluationOrder.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +NewInference +MixedNamedArgumentsInTheirOwnPosition +// !LANGUAGE: +MixedNamedArgumentsInTheirOwnPosition // See KT-17691: Wrong argument order in resolved call with varargs. (fixed in JVM_IR) var log = "" diff --git a/compiler/testData/codegen/box/package/referenceWithTheSameNameAsPackage.kt b/compiler/testData/codegen/box/package/referenceWithTheSameNameAsPackage.kt index 99387957c24..4097584fd31 100644 --- a/compiler/testData/codegen/box/package/referenceWithTheSameNameAsPackage.kt +++ b/compiler/testData/codegen/box/package/referenceWithTheSameNameAsPackage.kt @@ -1,6 +1,4 @@ -// !LANGUAGE: +NewInference // WITH_RUNTIME - // FILE: messages/foo.kt package messages @@ -20,4 +18,4 @@ class Test { fun box(): String { val result = Test().test() return if (result) "faile" else "OK" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/box/platformTypes/inferenceFlexibleTToNullable.kt b/compiler/testData/codegen/box/platformTypes/inferenceFlexibleTToNullable.kt index 85ad580e3a6..53e50e428f2 100644 --- a/compiler/testData/codegen/box/platformTypes/inferenceFlexibleTToNullable.kt +++ b/compiler/testData/codegen/box/platformTypes/inferenceFlexibleTToNullable.kt @@ -1,6 +1,5 @@ // IGNORE_BACKEND: JS, JS_IR, NATIVE // IGNORE_BACKEND: JS_IR_ES6 -// !LANGUAGE: +NewInference // FILE: Foo.java import org.jetbrains.annotations.NotNull; diff --git a/compiler/testData/codegen/box/regressions/kt33638.kt b/compiler/testData/codegen/box/regressions/kt33638.kt index d35c267e30b..4566925deff 100644 --- a/compiler/testData/codegen/box/regressions/kt33638.kt +++ b/compiler/testData/codegen/box/regressions/kt33638.kt @@ -1,4 +1,3 @@ -// !LANGUAGE: +NewInference // WITH_RUNTIME class Holder(val list: List?) diff --git a/compiler/testData/codegen/box/regressions/kt35914.kt b/compiler/testData/codegen/box/regressions/kt35914.kt index 9539c5c6eb1..ed1ba447548 100644 --- a/compiler/testData/codegen/box/regressions/kt35914.kt +++ b/compiler/testData/codegen/box/regressions/kt35914.kt @@ -1,4 +1,3 @@ -// !LANGUAGE: +NewInference // WITH_RUNTIME class Inv diff --git a/compiler/testData/codegen/box/regressions/noAssertionsWhenNullableTypeParameterReplacedWithIntersectionType.kt b/compiler/testData/codegen/box/regressions/noAssertionsWhenNullableTypeParameterReplacedWithIntersectionType.kt index 925ff26edd9..5cca7c991a8 100644 --- a/compiler/testData/codegen/box/regressions/noAssertionsWhenNullableTypeParameterReplacedWithIntersectionType.kt +++ b/compiler/testData/codegen/box/regressions/noAssertionsWhenNullableTypeParameterReplacedWithIntersectionType.kt @@ -1,5 +1,3 @@ -// !LANGUAGE: +NewInference - class Recursive> : Generic>, MainSupertype open class Simple : Generic, MainSupertype @@ -23,4 +21,4 @@ fun select(x: T?, y: T): T = y fun box(): String { takeElement(null, Simple()) return "OK" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/box/sam/arrayAsVarargAfterSamArgument.kt b/compiler/testData/codegen/box/sam/arrayAsVarargAfterSamArgument.kt index 74841f034bf..c2bdd520cb9 100644 --- a/compiler/testData/codegen/box/sam/arrayAsVarargAfterSamArgument.kt +++ b/compiler/testData/codegen/box/sam/arrayAsVarargAfterSamArgument.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +NewInference +SamConversionForKotlinFunctions +SamConversionPerArgument -ProhibitVarargAsArrayAfterSamArgument +// !LANGUAGE: -ProhibitVarargAsArrayAfterSamArgument // IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM diff --git a/compiler/testData/codegen/box/sam/partialSam.kt b/compiler/testData/codegen/box/sam/partialSam.kt index 1c5fda61fae..fd01b16316d 100644 --- a/compiler/testData/codegen/box/sam/partialSam.kt +++ b/compiler/testData/codegen/box/sam/partialSam.kt @@ -1,4 +1,3 @@ -// !LANGUAGE: +NewInference +SamConversionPerArgument // TARGET_BACKEND: JVM // WITH_RUNTIME // FILE: Fn.java @@ -41,4 +40,4 @@ fun box(): String { if (x != "LFoo42239 Bar1LFoo Foo42239 LBar1Foo") return x return "OK" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/box/sam/partialSamKT.kt b/compiler/testData/codegen/box/sam/partialSamKT.kt index 72de5267978..2327bac03d4 100644 --- a/compiler/testData/codegen/box/sam/partialSamKT.kt +++ b/compiler/testData/codegen/box/sam/partialSamKT.kt @@ -1,4 +1,3 @@ -// !LANGUAGE: +NewInference +SamConversionForKotlinFunctions +SamConversionPerArgument // TARGET_BACKEND: JVM // WITH_RUNTIME // FILE: Fn.java @@ -38,4 +37,4 @@ fun box(): String { if (x != "LFoo42239 Bar1LFoo Foo42239 LBar1Foo") return x return "OK" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/box/sam/recordSubstitutedTypeForCallableSamParameter.kt b/compiler/testData/codegen/box/sam/recordSubstitutedTypeForCallableSamParameter.kt index 3a3faa15e88..e9b5edd7644 100644 --- a/compiler/testData/codegen/box/sam/recordSubstitutedTypeForCallableSamParameter.kt +++ b/compiler/testData/codegen/box/sam/recordSubstitutedTypeForCallableSamParameter.kt @@ -1,4 +1,3 @@ -// !LANGUAGE: +NewInference +SamConversionPerArgument +SamConversionForKotlinFunctions +FunctionalInterfaceConversion // WITH_REFLECT // FULL_JDK // TARGET_BACKEND: JVM diff --git a/compiler/testData/codegen/box/vararg/kt37715.kt b/compiler/testData/codegen/box/vararg/kt37715.kt index f450f56a10a..fa01227766d 100644 --- a/compiler/testData/codegen/box/vararg/kt37715.kt +++ b/compiler/testData/codegen/box/vararg/kt37715.kt @@ -1,4 +1,3 @@ -// !LANGUAGE: +NewInference // WITH_RUNTIME // IR_DUMP diff --git a/compiler/testData/codegen/boxInline/callableReference/adaptedReferences/inlineDefault.kt b/compiler/testData/codegen/boxInline/callableReference/adaptedReferences/inlineDefault.kt index e20473cad9f..c9cad278153 100644 --- a/compiler/testData/codegen/boxInline/callableReference/adaptedReferences/inlineDefault.kt +++ b/compiler/testData/codegen/boxInline/callableReference/adaptedReferences/inlineDefault.kt @@ -1,6 +1,5 @@ // IGNORE_BACKEND: WASM // WASM_MUTE_REASON: STDLIB_TEXT -// !LANGUAGE: +NewInference +FunctionReferenceWithDefaultValueAsOtherType // WITH_RUNTIME // KJS_WITH_FULL_RUNTIME diff --git a/compiler/testData/codegen/boxInline/callableReference/adaptedReferences/inlineVararg.kt b/compiler/testData/codegen/boxInline/callableReference/adaptedReferences/inlineVararg.kt index c58a4e2fdc9..999acf56197 100644 --- a/compiler/testData/codegen/boxInline/callableReference/adaptedReferences/inlineVararg.kt +++ b/compiler/testData/codegen/boxInline/callableReference/adaptedReferences/inlineVararg.kt @@ -1,6 +1,5 @@ // IGNORE_BACKEND: WASM // WASM_MUTE_REASON: IGNORED_IN_JS -// !LANGUAGE: +NewInference // FILE: 1.kt package test diff --git a/compiler/testData/codegen/boxInline/callableReference/adaptedReferences/inlineVarargAndDefault.kt b/compiler/testData/codegen/boxInline/callableReference/adaptedReferences/inlineVarargAndDefault.kt index f3e286ce301..fbd52fac869 100644 --- a/compiler/testData/codegen/boxInline/callableReference/adaptedReferences/inlineVarargAndDefault.kt +++ b/compiler/testData/codegen/boxInline/callableReference/adaptedReferences/inlineVarargAndDefault.kt @@ -1,5 +1,3 @@ -// !LANGUAGE: +NewInference +FunctionReferenceWithDefaultValueAsOtherType - // FILE: 1.kt package test diff --git a/compiler/testData/codegen/boxInline/callableReference/adaptedReferences/inlineVarargInts.kt b/compiler/testData/codegen/boxInline/callableReference/adaptedReferences/inlineVarargInts.kt index 58f41020c96..0aecd5acfb3 100644 --- a/compiler/testData/codegen/boxInline/callableReference/adaptedReferences/inlineVarargInts.kt +++ b/compiler/testData/codegen/boxInline/callableReference/adaptedReferences/inlineVarargInts.kt @@ -1,4 +1,3 @@ -// !LANGUAGE: +NewInference // WITH_RUNTIME // KJS_WITH_FULL_RUNTIME diff --git a/compiler/testData/codegen/boxInline/callableReference/innerGenericConstuctor.kt b/compiler/testData/codegen/boxInline/callableReference/innerGenericConstuctor.kt index 7c9ebe1ea3f..588af9b331e 100644 --- a/compiler/testData/codegen/boxInline/callableReference/innerGenericConstuctor.kt +++ b/compiler/testData/codegen/boxInline/callableReference/innerGenericConstuctor.kt @@ -1,4 +1,3 @@ -// !LANGUAGE: +NewInference // FILE: 1.kt package test diff --git a/compiler/testData/codegen/bytecodeText/javaFieldsWithIntersectionTypes.kt b/compiler/testData/codegen/bytecodeText/javaFieldsWithIntersectionTypes.kt index 1fd5705907d..93bcb38f0f4 100644 --- a/compiler/testData/codegen/bytecodeText/javaFieldsWithIntersectionTypes.kt +++ b/compiler/testData/codegen/bytecodeText/javaFieldsWithIntersectionTypes.kt @@ -1,5 +1,3 @@ -// !LANGUAGE: +NewInference -// (old inference fails in the frontend) // FILE: JFieldOwner.java public class JFieldOwner { diff --git a/compiler/testData/ir/irText/expressions/callableReferences/adaptedExtensionFunctions.kt b/compiler/testData/ir/irText/expressions/callableReferences/adaptedExtensionFunctions.kt index 4f28093a511..5ead718fae1 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/adaptedExtensionFunctions.kt +++ b/compiler/testData/ir/irText/expressions/callableReferences/adaptedExtensionFunctions.kt @@ -1,5 +1,3 @@ -// !LANGUAGE: +NewInference +FunctionReferenceWithDefaultValueAsOtherType - fun use(f: C.(Int) -> Unit) {} class C @@ -20,4 +18,4 @@ fun testExtensionDefault() { fun testExtensionBoth() { use(C::extensionBoth) -} \ No newline at end of file +} diff --git a/compiler/testData/ir/irText/expressions/callableReferences/caoWithAdaptationForSam.kt b/compiler/testData/ir/irText/expressions/callableReferences/caoWithAdaptationForSam.kt index 00efbec53f2..490ae877d27 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/caoWithAdaptationForSam.kt +++ b/compiler/testData/ir/irText/expressions/callableReferences/caoWithAdaptationForSam.kt @@ -1,5 +1,4 @@ // IGNORE_BACKEND_FIR: JVM_IR -// !LANGUAGE: +NewInference +FunctionReferenceWithDefaultValueAsOtherType +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions fun interface IFoo { fun foo(i: Int) @@ -45,4 +44,4 @@ fun test6(a: Any) { a as (Int) -> Unit a as IFoo A[a] += 1 -} \ No newline at end of file +} diff --git a/compiler/testData/ir/irText/expressions/callableReferences/constructorWithAdaptedArguments.kt b/compiler/testData/ir/irText/expressions/callableReferences/constructorWithAdaptedArguments.kt index 765d6d88444..707a72e71db 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/constructorWithAdaptedArguments.kt +++ b/compiler/testData/ir/irText/expressions/callableReferences/constructorWithAdaptedArguments.kt @@ -1,5 +1,3 @@ -// !LANGUAGE: +NewInference, +FunctionReferenceWithDefaultValueAsOtherType - fun use(fn: (Int) -> Any) = fn(42) class C(vararg xs: Int) @@ -12,4 +10,4 @@ fun testConstructor() = use(::C) fun testInnerClassConstructor(outer: Outer) = use(outer::Inner) -fun testInnerClassConstructorCapturingOuter() = use(Outer()::Inner) \ No newline at end of file +fun testInnerClassConstructorCapturingOuter() = use(Outer()::Inner) diff --git a/compiler/testData/ir/irText/expressions/callableReferences/unboundMemberReferenceWithAdaptedArguments.kt b/compiler/testData/ir/irText/expressions/callableReferences/unboundMemberReferenceWithAdaptedArguments.kt index 0b730955ac9..7bb7f2c9002 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/unboundMemberReferenceWithAdaptedArguments.kt +++ b/compiler/testData/ir/irText/expressions/callableReferences/unboundMemberReferenceWithAdaptedArguments.kt @@ -1,5 +1,3 @@ -// !LANGUAGE: +NewInference, +FunctionReferenceWithDefaultValueAsOtherType - fun use1(fn: (A, Int) -> Unit) {} fun use2(fn: (Int) -> Unit) {} diff --git a/compiler/testData/ir/irText/expressions/callableReferences/withAdaptationForSam.kt b/compiler/testData/ir/irText/expressions/callableReferences/withAdaptationForSam.kt index 9a3b4408ff4..d70eb69a26c 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/withAdaptationForSam.kt +++ b/compiler/testData/ir/irText/expressions/callableReferences/withAdaptationForSam.kt @@ -1,5 +1,3 @@ -// !LANGUAGE: +NewInference +FunctionReferenceWithDefaultValueAsOtherType +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions - fun interface IFoo { fun foo(i: Int) } @@ -11,4 +9,3 @@ fun withVararg(vararg xs: Int) = 42 fun test() { useFoo(::withVararg) } - diff --git a/compiler/testData/ir/irText/expressions/callableReferences/withAdaptedArguments.kt b/compiler/testData/ir/irText/expressions/callableReferences/withAdaptedArguments.kt index 197261fc3a2..6fafb13037a 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/withAdaptedArguments.kt +++ b/compiler/testData/ir/irText/expressions/callableReferences/withAdaptedArguments.kt @@ -1,4 +1,3 @@ -// !LANGUAGE: +NewInference, +FunctionReferenceWithDefaultValueAsOtherType import Host.importedObjectMemberWithVarargs fun use(fn: (Int) -> String) = fn(1) @@ -27,4 +26,4 @@ fun testImportedObjectMember() = use(::importedObjectMemberWithVarargs) fun testDefault0() = use0(::fnWithDefaults) -fun testVararg0() = use0(::fnWithVarargs) \ No newline at end of file +fun testVararg0() = use0(::fnWithVarargs) diff --git a/compiler/testData/ir/irText/expressions/callableReferences/withArgumentAdaptationAndReceiver.kt b/compiler/testData/ir/irText/expressions/callableReferences/withArgumentAdaptationAndReceiver.kt index b134db8cf1f..2758838496b 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/withArgumentAdaptationAndReceiver.kt +++ b/compiler/testData/ir/irText/expressions/callableReferences/withArgumentAdaptationAndReceiver.kt @@ -1,5 +1,3 @@ -// !LANGUAGE: +NewInference, +FunctionReferenceWithDefaultValueAsOtherType - fun use(fn: (Int) -> Unit) { fn(1) } class Host { @@ -26,4 +24,4 @@ class Host { fun testBoundReceiverExpression() { use(Host()::withVararg) } -} \ No newline at end of file +} diff --git a/compiler/testData/ir/irText/expressions/callableReferences/withVarargViewedAsArray.kt b/compiler/testData/ir/irText/expressions/callableReferences/withVarargViewedAsArray.kt index 5ee75aec534..b73d421b400 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/withVarargViewedAsArray.kt +++ b/compiler/testData/ir/irText/expressions/callableReferences/withVarargViewedAsArray.kt @@ -1,5 +1,3 @@ -// !LANGUAGE: +NewInference, +FunctionReferenceWithDefaultValueAsOtherType - fun sum(vararg args: Int): Int { var result = 0 for (arg in args) diff --git a/compiler/testData/ir/irText/expressions/funInterface/arrayAsVarargAfterSamArgument_fi.kt b/compiler/testData/ir/irText/expressions/funInterface/arrayAsVarargAfterSamArgument_fi.kt index d20401c07f4..85b18bff1f1 100644 --- a/compiler/testData/ir/irText/expressions/funInterface/arrayAsVarargAfterSamArgument_fi.kt +++ b/compiler/testData/ir/irText/expressions/funInterface/arrayAsVarargAfterSamArgument_fi.kt @@ -1,5 +1,4 @@ // FIR_IDENTICAL -// !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions fun interface IRunnable { fun run() diff --git a/compiler/testData/ir/irText/expressions/funInterface/basicFunInterfaceConversion.kt b/compiler/testData/ir/irText/expressions/funInterface/basicFunInterfaceConversion.kt index 1aee6958341..55eb2be084e 100644 --- a/compiler/testData/ir/irText/expressions/funInterface/basicFunInterfaceConversion.kt +++ b/compiler/testData/ir/irText/expressions/funInterface/basicFunInterfaceConversion.kt @@ -1,5 +1,4 @@ // FIR_IDENTICAL -// !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions fun interface Foo { fun invoke(): String @@ -7,4 +6,4 @@ fun interface Foo { fun foo(f: Foo) = f.invoke() -fun test() = foo { "OK" } \ No newline at end of file +fun test() = foo { "OK" } diff --git a/compiler/testData/ir/irText/expressions/funInterface/castFromAny.kt b/compiler/testData/ir/irText/expressions/funInterface/castFromAny.kt index 10e88207378..094f948c706 100644 --- a/compiler/testData/ir/irText/expressions/funInterface/castFromAny.kt +++ b/compiler/testData/ir/irText/expressions/funInterface/castFromAny.kt @@ -1,5 +1,4 @@ // FIR_IDENTICAL -// !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions fun interface KRunnable { fun invoke() @@ -9,4 +8,3 @@ fun test(a: Any?) { a as () -> Unit KRunnable(a).invoke() } - diff --git a/compiler/testData/ir/irText/expressions/funInterface/partialSam.kt b/compiler/testData/ir/irText/expressions/funInterface/partialSam.kt index 9ad7fde61e5..544b9fb0c0b 100644 --- a/compiler/testData/ir/irText/expressions/funInterface/partialSam.kt +++ b/compiler/testData/ir/irText/expressions/funInterface/partialSam.kt @@ -1,4 +1,3 @@ -// !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions // WITH_RUNTIME fun interface Fn { diff --git a/compiler/testData/ir/irText/expressions/funInterface/samConversionInVarargs.kt b/compiler/testData/ir/irText/expressions/funInterface/samConversionInVarargs.kt index 89dbd62cf78..cd4b1e76948 100644 --- a/compiler/testData/ir/irText/expressions/funInterface/samConversionInVarargs.kt +++ b/compiler/testData/ir/irText/expressions/funInterface/samConversionInVarargs.kt @@ -1,5 +1,3 @@ -// !LANGUAGE: +NewInference +FunctionReferenceWithDefaultValueAsOtherType +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions - fun interface IFoo { fun foo(i: Int) } @@ -18,4 +16,4 @@ fun withVarargOfInt(vararg xs: Int) = "" fun testAdaptedCR() { useVararg(::withVarargOfInt) -} \ No newline at end of file +} diff --git a/compiler/testData/ir/irText/expressions/funInterface/samConversionInVarargsMixed.kt b/compiler/testData/ir/irText/expressions/funInterface/samConversionInVarargsMixed.kt index bbaeb03038c..84091c2dbbc 100644 --- a/compiler/testData/ir/irText/expressions/funInterface/samConversionInVarargsMixed.kt +++ b/compiler/testData/ir/irText/expressions/funInterface/samConversionInVarargsMixed.kt @@ -1,4 +1,3 @@ -// !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument fun interface MyRunnable { fun run() } diff --git a/compiler/testData/ir/irText/expressions/funInterface/samConversionOnCallableReference.kt b/compiler/testData/ir/irText/expressions/funInterface/samConversionOnCallableReference.kt index bdbd5c12bc4..00d35747025 100644 --- a/compiler/testData/ir/irText/expressions/funInterface/samConversionOnCallableReference.kt +++ b/compiler/testData/ir/irText/expressions/funInterface/samConversionOnCallableReference.kt @@ -1,4 +1,3 @@ -// !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions fun interface KRunnable { fun run() } @@ -22,4 +21,4 @@ fun testSamConversion() { // TODO should use an adapter function fun testSamConversionOnAdapted() { use(::foo1) -} \ No newline at end of file +} diff --git a/compiler/testData/ir/irText/expressions/funInterface/samConversionsWithSmartCasts.fir.ir.txt b/compiler/testData/ir/irText/expressions/funInterface/samConversionsWithSmartCasts.fir.ir.txt index 86e5d5b4cdb..c55cf0c488d 100644 --- a/compiler/testData/ir/irText/expressions/funInterface/samConversionsWithSmartCasts.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/funInterface/samConversionsWithSmartCasts.fir.ir.txt @@ -114,6 +114,56 @@ FILE fqName: fileName:/samConversionsWithSmartCasts.kt r: TYPE_OP type=.KRunnable origin=SAM_CONVERSION typeOperand=.KRunnable TYPE_OP type=kotlin.Function0 origin=IMPLICIT_CAST typeOperand=kotlin.Function0 GET_VAR 'a: kotlin.Any declared in .test6' type=kotlin.Any origin=null + FUN name:test7 visibility:public modality:FINAL <> (a:kotlin.Function1) returnType:kotlin.Unit + VALUE_PARAMETER name:a index:0 type:kotlin.Function1 + BLOCK_BODY + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + TYPE_OP type=kotlin.Function0 origin=CAST typeOperand=kotlin.Function0 + GET_VAR 'a: kotlin.Function1 declared in .test7' type=kotlin.Function1 origin=null + CALL 'public final fun run1 (r: .KRunnable): kotlin.Unit declared in ' type=kotlin.Unit origin=null + r: TYPE_OP type=.KRunnable origin=SAM_CONVERSION typeOperand=.KRunnable + TYPE_OP type=kotlin.Function0 origin=IMPLICIT_CAST typeOperand=kotlin.Function0 + GET_VAR 'a: kotlin.Function1 declared in .test7' type=kotlin.Function1 origin=null + FUN name:test7a visibility:public modality:FINAL (a:T of .test7a) returnType:kotlin.Unit + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Function1] + VALUE_PARAMETER name:a index:0 type:T of .test7a + BLOCK_BODY + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + TYPE_OP type=kotlin.Function0 origin=CAST typeOperand=kotlin.Function0 + GET_VAR 'a: T of .test7a declared in .test7a' type=T of .test7a origin=null + CALL 'public final fun run1 (r: .KRunnable): kotlin.Unit declared in ' type=kotlin.Unit origin=null + r: TYPE_OP type=.KRunnable origin=SAM_CONVERSION typeOperand=.KRunnable + TYPE_OP type=kotlin.Function0 origin=IMPLICIT_CAST typeOperand=kotlin.Function0 + GET_VAR 'a: T of .test7a declared in .test7a' type=T of .test7a origin=null + FUN name:test7b visibility:public modality:FINAL (a:T of .test7b) returnType:kotlin.Unit + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Function1; kotlin.Function0] + VALUE_PARAMETER name:a index:0 type:T of .test7b + BLOCK_BODY + CALL 'public final fun run1 (r: .KRunnable): kotlin.Unit declared in ' type=kotlin.Unit origin=null + r: TYPE_OP type=.KRunnable origin=SAM_CONVERSION typeOperand=.KRunnable + GET_VAR 'a: T of .test7b declared in .test7b' type=T of .test7b origin=null + CLASS INTERFACE name:Unrelated modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Unrelated + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test7c visibility:public modality:FINAL (a:T of .test7c) returnType:kotlin.Unit + TYPE_PARAMETER name:T index:0 variance: superTypes:[.Unrelated; kotlin.Function0] + VALUE_PARAMETER name:a index:0 type:T of .test7c + BLOCK_BODY + CALL 'public final fun run1 (r: .KRunnable): kotlin.Unit declared in ' type=kotlin.Unit origin=null + r: TYPE_OP type=.KRunnable origin=SAM_CONVERSION typeOperand=.KRunnable + GET_VAR 'a: T of .test7c declared in .test7c' type=T of .test7c origin=null FUN name:test8 visibility:public modality:FINAL <> (a:kotlin.Function0) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:kotlin.Function0 BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/funInterface/samConversionsWithSmartCasts.fir.kt.txt b/compiler/testData/ir/irText/expressions/funInterface/samConversionsWithSmartCasts.fir.kt.txt index b769f5e4a61..26d81660bf5 100644 --- a/compiler/testData/ir/irText/expressions/funInterface/samConversionsWithSmartCasts.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/funInterface/samConversionsWithSmartCasts.fir.kt.txt @@ -60,6 +60,28 @@ fun test6(a: Any) { run1(r = a /*as Function0 */ /*-> KRunnable */) } +fun test7(a: Function1) { + a as Function0 /*~> Unit */ + run1(r = a /*as Function0 */ /*-> KRunnable */) +} + +fun > test7a(a: T) { + a as Function0 /*~> Unit */ + run1(r = a /*as Function0 */ /*-> KRunnable */) +} + +fun test7b(a: T) where T : Function1, T : Function0 { + run1(r = a /*-> KRunnable */) +} + +interface Unrelated { + +} + +fun test7c(a: T) where T : Unrelated, T : Function0 { + run1(r = a /*-> KRunnable */) +} + fun test8(a: Function0) { run1(r = id>(x = a) /*-> KRunnable */) } diff --git a/compiler/testData/ir/irText/expressions/funInterface/samConversionsWithSmartCasts.ir.txt b/compiler/testData/ir/irText/expressions/funInterface/samConversionsWithSmartCasts.ir.txt index 445044495c5..71e9f9f9d4b 100644 --- a/compiler/testData/ir/irText/expressions/funInterface/samConversionsWithSmartCasts.ir.txt +++ b/compiler/testData/ir/irText/expressions/funInterface/samConversionsWithSmartCasts.ir.txt @@ -116,6 +116,56 @@ FILE fqName: fileName:/samConversionsWithSmartCasts.kt r: TYPE_OP type=.KRunnable origin=SAM_CONVERSION typeOperand=.KRunnable TYPE_OP type=kotlin.Function0 origin=IMPLICIT_CAST typeOperand=kotlin.Function0 GET_VAR 'a: kotlin.Any declared in .test6' type=kotlin.Any origin=null + FUN name:test7 visibility:public modality:FINAL <> (a:kotlin.Function1) returnType:kotlin.Unit + VALUE_PARAMETER name:a index:0 type:kotlin.Function1 + BLOCK_BODY + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + TYPE_OP type=kotlin.Function0 origin=CAST typeOperand=kotlin.Function0 + GET_VAR 'a: kotlin.Function1 declared in .test7' type=kotlin.Function1 origin=null + CALL 'public final fun run1 (r: .KRunnable): kotlin.Unit declared in ' type=kotlin.Unit origin=null + r: TYPE_OP type=.KRunnable origin=SAM_CONVERSION typeOperand=.KRunnable + TYPE_OP type=kotlin.Function0 origin=IMPLICIT_CAST typeOperand=kotlin.Function0 + GET_VAR 'a: kotlin.Function1 declared in .test7' type=kotlin.Function1 origin=null + FUN name:test7a visibility:public modality:FINAL (a:T of .test7a) returnType:kotlin.Unit + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Function1] + VALUE_PARAMETER name:a index:0 type:T of .test7a + BLOCK_BODY + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + TYPE_OP type=kotlin.Function0 origin=CAST typeOperand=kotlin.Function0 + GET_VAR 'a: T of .test7a declared in .test7a' type=T of .test7a origin=null + CALL 'public final fun run1 (r: .KRunnable): kotlin.Unit declared in ' type=kotlin.Unit origin=null + r: TYPE_OP type=.KRunnable origin=SAM_CONVERSION typeOperand=.KRunnable + TYPE_OP type=kotlin.Function0 origin=IMPLICIT_CAST typeOperand=kotlin.Function0 + GET_VAR 'a: T of .test7a declared in .test7a' type=T of .test7a origin=null + FUN name:test7b visibility:public modality:FINAL (a:T of .test7b) returnType:kotlin.Unit + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Function1; kotlin.Function0] + VALUE_PARAMETER name:a index:0 type:T of .test7b + BLOCK_BODY + CALL 'public final fun run1 (r: .KRunnable): kotlin.Unit declared in ' type=kotlin.Unit origin=null + r: TYPE_OP type=.KRunnable origin=SAM_CONVERSION typeOperand=.KRunnable + GET_VAR 'a: T of .test7b declared in .test7b' type=T of .test7b origin=null + CLASS INTERFACE name:Unrelated modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Unrelated + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test7c visibility:public modality:FINAL (a:T of .test7c) returnType:kotlin.Unit + TYPE_PARAMETER name:T index:0 variance: superTypes:[.Unrelated; kotlin.Function0] + VALUE_PARAMETER name:a index:0 type:T of .test7c + BLOCK_BODY + CALL 'public final fun run1 (r: .KRunnable): kotlin.Unit declared in ' type=kotlin.Unit origin=null + r: TYPE_OP type=.KRunnable origin=SAM_CONVERSION typeOperand=.KRunnable + GET_VAR 'a: T of .test7c declared in .test7c' type=T of .test7c origin=null FUN name:test8 visibility:public modality:FINAL <> (a:kotlin.Function0) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:kotlin.Function0 BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/funInterface/samConversionsWithSmartCasts.kt b/compiler/testData/ir/irText/expressions/funInterface/samConversionsWithSmartCasts.kt index 5a09bc36b7c..e5e4a65a59d 100644 --- a/compiler/testData/ir/irText/expressions/funInterface/samConversionsWithSmartCasts.kt +++ b/compiler/testData/ir/irText/expressions/funInterface/samConversionsWithSmartCasts.kt @@ -1,4 +1,3 @@ -// !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions fun interface KRunnable { fun run() } @@ -53,26 +52,25 @@ fun test6(a: Any) { run1(a) } -// TODO see KT-36013 -//fun test7(a: (Int) -> Int) { -// a as () -> Unit -// run1(a) -//} -// -//fun Int> test7a(a: T) { -// a as () -> Unit -// run1(a) -//} -// -//fun test7b(a: T) where T : (Int) -> Int, T : () -> Unit { -// run1(a) -//} -// -//interface Unrelated -// -//fun test7c(a: T) where T : Unrelated, T : () -> Unit { -// run1(a) -//} +fun test7(a: (Int) -> Int) { + a as () -> Unit + run1(a) +} + +fun Int> test7a(a: T) { + a as () -> Unit + run1(a) +} + +fun test7b(a: T) where T : (Int) -> Unit, T : () -> Unit { + run1(a) +} + +interface Unrelated + +fun test7c(a: T) where T : Unrelated, T : () -> Unit { + run1(a) +} fun test8(a: () -> Unit) { run1(id(a)) diff --git a/compiler/testData/ir/irText/expressions/funInterface/samConversionsWithSmartCasts.kt.txt b/compiler/testData/ir/irText/expressions/funInterface/samConversionsWithSmartCasts.kt.txt index c10bc3ef2e0..f6f23ec1a52 100644 --- a/compiler/testData/ir/irText/expressions/funInterface/samConversionsWithSmartCasts.kt.txt +++ b/compiler/testData/ir/irText/expressions/funInterface/samConversionsWithSmartCasts.kt.txt @@ -68,6 +68,28 @@ fun test6(a: Any) { run1(r = a /*as Function0 */ /*-> KRunnable */) } +fun test7(a: Function1) { + a as Function0 /*~> Unit */ + run1(r = a /*as Function0 */ /*-> KRunnable */) +} + +fun > test7a(a: T) { + a as Function0 /*~> Unit */ + run1(r = a /*as Function0 */ /*-> KRunnable */) +} + +fun test7b(a: T) where T : Function1, T : Function0 { + run1(r = a /*-> KRunnable */) +} + +interface Unrelated { + +} + +fun test7c(a: T) where T : Unrelated, T : Function0 { + run1(r = a /*-> KRunnable */) +} + fun test8(a: Function0) { run1(r = id>(x = a) /*-> KRunnable */) } diff --git a/compiler/testData/ir/irText/expressions/jvmFieldReferenceWithIntersectionTypes.kt b/compiler/testData/ir/irText/expressions/jvmFieldReferenceWithIntersectionTypes.kt index 12658a32a09..1c9fba50ac5 100644 --- a/compiler/testData/ir/irText/expressions/jvmFieldReferenceWithIntersectionTypes.kt +++ b/compiler/testData/ir/irText/expressions/jvmFieldReferenceWithIntersectionTypes.kt @@ -1,6 +1,4 @@ // TARGET_BACKEND: JVM -// !LANGUAGE: +NewInference -// (old inference fails in the frontend) // FILE: JFieldOwner.java public class JFieldOwner { diff --git a/compiler/testData/ir/irText/expressions/sam/arrayAsVarargAfterSamArgument.kt b/compiler/testData/ir/irText/expressions/sam/arrayAsVarargAfterSamArgument.kt index 000e730237a..efe29ac8f2d 100644 --- a/compiler/testData/ir/irText/expressions/sam/arrayAsVarargAfterSamArgument.kt +++ b/compiler/testData/ir/irText/expressions/sam/arrayAsVarargAfterSamArgument.kt @@ -1,6 +1,6 @@ // IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM -// !LANGUAGE: +NewInference +SamConversionPerArgument +SamConversionForKotlinFunctions -ProhibitVarargAsArrayAfterSamArgument +// !LANGUAGE: -ProhibitVarargAsArrayAfterSamArgument // WITH_JDK // FILE: arrayAsVarargAfterSamArgument.kt diff --git a/compiler/testData/ir/irText/expressions/sam/genericSamProjectedOut.fir.ir.txt b/compiler/testData/ir/irText/expressions/sam/genericSamProjectedOut.fir.ir.txt index f63e42ee7d5..493b97a26cb 100644 --- a/compiler/testData/ir/irText/expressions/sam/genericSamProjectedOut.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/sam/genericSamProjectedOut.fir.ir.txt @@ -1,18 +1,11 @@ FILE fqName: fileName:/genericSamProjectedOut.kt - FUN name:test visibility:public modality:FINAL <> (a:example.SomeJavaClass) returnType:kotlin.Unit - VALUE_PARAMETER name:a index:0 type:example.SomeJavaClass + FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY + VAR name:a type:example.SomeJavaClass [var] + CONSTRUCTOR_CALL 'public constructor () [primary] declared in example.SomeJavaClass' type=example.SomeJavaClass origin=null + : kotlin.String CALL 'public open fun someFunction (hello: @[FlexibleNullability] example.Hello<@[FlexibleNullability] A of example.SomeJavaClass?>?): kotlin.Unit declared in example.SomeJavaClass' type=kotlin.Unit origin=null - $this: GET_VAR 'a: example.SomeJavaClass declared in .test' type=example.SomeJavaClass origin=null - hello: TYPE_OP type=@[FlexibleNullability] example.Hello<@[FlexibleNullability] kotlin.String?>? origin=SAM_CONVERSION typeOperand=@[FlexibleNullability] example.Hello<@[FlexibleNullability] kotlin.String?>? - FUN_EXPR type=kotlin.Function1<@[FlexibleNullability] kotlin.String?, kotlin.Unit> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (it:@[FlexibleNullability] kotlin.String?) returnType:kotlin.Unit - VALUE_PARAMETER name:it index:0 type:@[FlexibleNullability] kotlin.String? - BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun (it: @[FlexibleNullability] kotlin.String?): kotlin.Unit declared in .test' - GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit - CALL 'public open fun plus (hello: @[FlexibleNullability] example.Hello<@[FlexibleNullability] A of example.SomeJavaClass?>?): kotlin.Unit [operator] declared in example.SomeJavaClass' type=kotlin.Unit origin=PLUS - $this: GET_VAR 'a: example.SomeJavaClass declared in .test' type=example.SomeJavaClass origin=null + $this: GET_VAR 'var a: example.SomeJavaClass [var] declared in .test' type=example.SomeJavaClass origin=null hello: TYPE_OP type=@[FlexibleNullability] example.Hello<@[FlexibleNullability] kotlin.String?>? origin=SAM_CONVERSION typeOperand=@[FlexibleNullability] example.Hello<@[FlexibleNullability] kotlin.String?>? FUN_EXPR type=kotlin.Function1<@[FlexibleNullability] kotlin.String?, kotlin.Unit> origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (it:@[FlexibleNullability] kotlin.String?) returnType:kotlin.Unit @@ -20,8 +13,38 @@ FILE fqName: fileName:/genericSamProjectedOut.kt BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (it: @[FlexibleNullability] kotlin.String?): kotlin.Unit declared in .test' GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public open fun plus (hello: @[FlexibleNullability] example.Hello<@[FlexibleNullability] A of example.SomeJavaClass?>?): @[FlexibleNullability] example.SomeJavaClass<@[FlexibleNullability] A of example.SomeJavaClass?>? [operator] declared in example.SomeJavaClass' type=@[FlexibleNullability] example.SomeJavaClass? origin=PLUS + $this: GET_VAR 'var a: example.SomeJavaClass [var] declared in .test' type=example.SomeJavaClass origin=null + hello: TYPE_OP type=@[FlexibleNullability] example.Hello<@[FlexibleNullability] kotlin.String?>? origin=SAM_CONVERSION typeOperand=@[FlexibleNullability] example.Hello<@[FlexibleNullability] kotlin.String?>? + FUN_EXPR type=kotlin.Function1<@[FlexibleNullability] kotlin.String?, kotlin.Unit> origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (it:@[FlexibleNullability] kotlin.String?) returnType:kotlin.Unit + VALUE_PARAMETER name:it index:0 type:@[FlexibleNullability] kotlin.String? + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (it: @[FlexibleNullability] kotlin.String?): kotlin.Unit declared in .test' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit CALL 'public open fun get (hello: @[FlexibleNullability] example.Hello<@[FlexibleNullability] A of example.SomeJavaClass?>?): kotlin.Unit [operator] declared in example.SomeJavaClass' type=kotlin.Unit origin=null - $this: GET_VAR 'a: example.SomeJavaClass declared in .test' type=example.SomeJavaClass origin=null + $this: GET_VAR 'var a: example.SomeJavaClass [var] declared in .test' type=example.SomeJavaClass origin=null + hello: TYPE_OP type=@[FlexibleNullability] example.Hello<@[FlexibleNullability] kotlin.String?>? origin=SAM_CONVERSION typeOperand=@[FlexibleNullability] example.Hello<@[FlexibleNullability] kotlin.String?>? + FUN_EXPR type=kotlin.Function1<@[FlexibleNullability] kotlin.String?, kotlin.Unit> origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (it:@[FlexibleNullability] kotlin.String?) returnType:kotlin.Unit + VALUE_PARAMETER name:it index:0 type:@[FlexibleNullability] kotlin.String? + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (it: @[FlexibleNullability] kotlin.String?): kotlin.Unit declared in .test' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit + SET_VAR 'var a: example.SomeJavaClass [var] declared in .test' type=kotlin.Unit origin=EQ + CALL 'public open fun plus (hello: @[FlexibleNullability] example.Hello<@[FlexibleNullability] A of example.SomeJavaClass?>?): @[FlexibleNullability] example.SomeJavaClass<@[FlexibleNullability] A of example.SomeJavaClass?>? [operator] declared in example.SomeJavaClass' type=@[FlexibleNullability] example.SomeJavaClass? origin=null + $this: GET_VAR 'var a: example.SomeJavaClass [var] declared in .test' type=example.SomeJavaClass origin=null + hello: TYPE_OP type=@[FlexibleNullability] example.Hello<@[FlexibleNullability] kotlin.String?>? origin=SAM_CONVERSION typeOperand=@[FlexibleNullability] example.Hello<@[FlexibleNullability] kotlin.String?>? + FUN_EXPR type=kotlin.Function1<@[FlexibleNullability] kotlin.String?, kotlin.Unit> origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (it:@[FlexibleNullability] kotlin.String?) returnType:kotlin.Unit + VALUE_PARAMETER name:it index:0 type:@[FlexibleNullability] kotlin.String? + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (it: @[FlexibleNullability] kotlin.String?): kotlin.Unit declared in .test' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit + CALL 'public open fun set (i: kotlin.Int, hello: @[FlexibleNullability] example.Hello<@[FlexibleNullability] A of example.SomeJavaClass?>?): kotlin.Unit [operator] declared in example.SomeJavaClass' type=kotlin.Unit origin=null + $this: GET_VAR 'var a: example.SomeJavaClass [var] declared in .test' type=example.SomeJavaClass origin=null + i: CONST Int type=kotlin.Int value=0 hello: TYPE_OP type=@[FlexibleNullability] example.Hello<@[FlexibleNullability] kotlin.String?>? origin=SAM_CONVERSION typeOperand=@[FlexibleNullability] example.Hello<@[FlexibleNullability] kotlin.String?>? FUN_EXPR type=kotlin.Function1<@[FlexibleNullability] kotlin.String?, kotlin.Unit> origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (it:@[FlexibleNullability] kotlin.String?) returnType:kotlin.Unit diff --git a/compiler/testData/ir/irText/expressions/sam/genericSamProjectedOut.fir.kt.txt b/compiler/testData/ir/irText/expressions/sam/genericSamProjectedOut.fir.kt.txt index a04abda853b..a331e6ca50b 100644 --- a/compiler/testData/ir/irText/expressions/sam/genericSamProjectedOut.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/sam/genericSamProjectedOut.fir.kt.txt @@ -1,4 +1,5 @@ -fun test(a: SomeJavaClass) { +fun test() { + var a: SomeJavaClass = SomeJavaClass() a.someFunction(hello = local fun (it: @FlexibleNullability String?) { return Unit } @@ -6,9 +7,17 @@ fun test(a: SomeJavaClass) { a.plus(hello = local fun (it: @FlexibleNullability String?) { return Unit } - /*-> @FlexibleNullability Hello<@FlexibleNullability String?>? */) + /*-> @FlexibleNullability Hello<@FlexibleNullability String?>? */) /*~> Unit */ a.get(hello = local fun (it: @FlexibleNullability String?) { return Unit } /*-> @FlexibleNullability Hello<@FlexibleNullability String?>? */) + a = a.plus(hello = local fun (it: @FlexibleNullability String?) { + return Unit + } + /*-> @FlexibleNullability Hello<@FlexibleNullability String?>? */) + a.set(i = 0, hello = local fun (it: @FlexibleNullability String?) { + return Unit + } + /*-> @FlexibleNullability Hello<@FlexibleNullability String?>? */) } diff --git a/compiler/testData/ir/irText/expressions/sam/genericSamProjectedOut.ir.txt b/compiler/testData/ir/irText/expressions/sam/genericSamProjectedOut.ir.txt index e75ce63b23e..b9ca851e436 100644 --- a/compiler/testData/ir/irText/expressions/sam/genericSamProjectedOut.ir.txt +++ b/compiler/testData/ir/irText/expressions/sam/genericSamProjectedOut.ir.txt @@ -1,18 +1,11 @@ FILE fqName: fileName:/genericSamProjectedOut.kt - FUN name:test visibility:public modality:FINAL <> (a:example.SomeJavaClass) returnType:kotlin.Unit - VALUE_PARAMETER name:a index:0 type:example.SomeJavaClass + FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY + VAR name:a type:example.SomeJavaClass [var] + CONSTRUCTOR_CALL 'public constructor () [primary] declared in example.SomeJavaClass' type=example.SomeJavaClass origin=null + : kotlin.String CALL 'public open fun someFunction (hello: @[FlexibleNullability] example.Hello<@[FlexibleNullability] A of example.SomeJavaClass?>?): kotlin.Unit declared in example.SomeJavaClass' type=kotlin.Unit origin=null - $this: GET_VAR 'a: example.SomeJavaClass declared in .test' type=example.SomeJavaClass origin=null - hello: TYPE_OP type=@[FlexibleNullability] example.Hello? origin=SAM_CONVERSION typeOperand=@[FlexibleNullability] example.Hello? - FUN_EXPR type=kotlin.Function1<@[FlexibleNullability] kotlin.String?, kotlin.Unit> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (it:@[FlexibleNullability] kotlin.String?) returnType:kotlin.Unit - VALUE_PARAMETER name:it index:0 type:@[FlexibleNullability] kotlin.String? - BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun (it: @[FlexibleNullability] kotlin.String?): kotlin.Unit declared in .test' - GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit - CALL 'public open fun plus (hello: @[FlexibleNullability] example.Hello<@[FlexibleNullability] A of example.SomeJavaClass?>?): kotlin.Unit [operator] declared in example.SomeJavaClass' type=kotlin.Unit origin=PLUS - $this: GET_VAR 'a: example.SomeJavaClass declared in .test' type=example.SomeJavaClass origin=null + $this: GET_VAR 'var a: example.SomeJavaClass [var] declared in .test' type=example.SomeJavaClass origin=null hello: TYPE_OP type=@[FlexibleNullability] example.Hello? origin=SAM_CONVERSION typeOperand=@[FlexibleNullability] example.Hello? FUN_EXPR type=kotlin.Function1<@[FlexibleNullability] kotlin.String?, kotlin.Unit> origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (it:@[FlexibleNullability] kotlin.String?) returnType:kotlin.Unit @@ -20,8 +13,39 @@ FILE fqName: fileName:/genericSamProjectedOut.kt BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (it: @[FlexibleNullability] kotlin.String?): kotlin.Unit declared in .test' GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public open fun plus (hello: @[FlexibleNullability] example.Hello<@[FlexibleNullability] A of example.SomeJavaClass?>?): @[FlexibleNullability] example.SomeJavaClass<@[FlexibleNullability] A of example.SomeJavaClass?>? [operator] declared in example.SomeJavaClass' type=@[FlexibleNullability] example.SomeJavaClass? origin=PLUS + $this: GET_VAR 'var a: example.SomeJavaClass [var] declared in .test' type=example.SomeJavaClass origin=null + hello: TYPE_OP type=@[FlexibleNullability] example.Hello? origin=SAM_CONVERSION typeOperand=@[FlexibleNullability] example.Hello? + FUN_EXPR type=kotlin.Function1<@[FlexibleNullability] kotlin.String?, kotlin.Unit> origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (it:@[FlexibleNullability] kotlin.String?) returnType:kotlin.Unit + VALUE_PARAMETER name:it index:0 type:@[FlexibleNullability] kotlin.String? + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (it: @[FlexibleNullability] kotlin.String?): kotlin.Unit declared in .test' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit CALL 'public open fun get (hello: @[FlexibleNullability] example.Hello<@[FlexibleNullability] A of example.SomeJavaClass?>?): kotlin.Unit [operator] declared in example.SomeJavaClass' type=kotlin.Unit origin=GET_ARRAY_ELEMENT - $this: GET_VAR 'a: example.SomeJavaClass declared in .test' type=example.SomeJavaClass origin=null + $this: GET_VAR 'var a: example.SomeJavaClass [var] declared in .test' type=example.SomeJavaClass origin=null + hello: TYPE_OP type=@[FlexibleNullability] example.Hello? origin=SAM_CONVERSION typeOperand=@[FlexibleNullability] example.Hello? + FUN_EXPR type=kotlin.Function1<@[FlexibleNullability] kotlin.String?, kotlin.Unit> origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (it:@[FlexibleNullability] kotlin.String?) returnType:kotlin.Unit + VALUE_PARAMETER name:it index:0 type:@[FlexibleNullability] kotlin.String? + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (it: @[FlexibleNullability] kotlin.String?): kotlin.Unit declared in .test' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit + SET_VAR 'var a: example.SomeJavaClass [var] declared in .test' type=kotlin.Unit origin=PLUSEQ + TYPE_OP type=example.SomeJavaClass origin=IMPLICIT_NOTNULL typeOperand=example.SomeJavaClass + CALL 'public open fun plus (hello: @[FlexibleNullability] example.Hello<@[FlexibleNullability] A of example.SomeJavaClass?>?): @[FlexibleNullability] example.SomeJavaClass<@[FlexibleNullability] A of example.SomeJavaClass?>? [operator] declared in example.SomeJavaClass' type=@[FlexibleNullability] example.SomeJavaClass? origin=PLUSEQ + $this: GET_VAR 'var a: example.SomeJavaClass [var] declared in .test' type=example.SomeJavaClass origin=PLUSEQ + hello: TYPE_OP type=@[FlexibleNullability] example.Hello? origin=SAM_CONVERSION typeOperand=@[FlexibleNullability] example.Hello? + FUN_EXPR type=kotlin.Function1<@[FlexibleNullability] kotlin.String?, kotlin.Unit> origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (it:@[FlexibleNullability] kotlin.String?) returnType:kotlin.Unit + VALUE_PARAMETER name:it index:0 type:@[FlexibleNullability] kotlin.String? + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (it: @[FlexibleNullability] kotlin.String?): kotlin.Unit declared in .test' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit + CALL 'public open fun set (i: kotlin.Int, hello: @[FlexibleNullability] example.Hello<@[FlexibleNullability] A of example.SomeJavaClass?>?): kotlin.Unit [operator] declared in example.SomeJavaClass' type=kotlin.Unit origin=EQ + $this: GET_VAR 'var a: example.SomeJavaClass [var] declared in .test' type=example.SomeJavaClass origin=null + i: CONST Int type=kotlin.Int value=0 hello: TYPE_OP type=@[FlexibleNullability] example.Hello? origin=SAM_CONVERSION typeOperand=@[FlexibleNullability] example.Hello? FUN_EXPR type=kotlin.Function1<@[FlexibleNullability] kotlin.String?, kotlin.Unit> origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (it:@[FlexibleNullability] kotlin.String?) returnType:kotlin.Unit diff --git a/compiler/testData/ir/irText/expressions/sam/genericSamProjectedOut.kt b/compiler/testData/ir/irText/expressions/sam/genericSamProjectedOut.kt index 4e624014459..7861f56a585 100644 --- a/compiler/testData/ir/irText/expressions/sam/genericSamProjectedOut.kt +++ b/compiler/testData/ir/irText/expressions/sam/genericSamProjectedOut.kt @@ -1,10 +1,10 @@ -// !LANGUAGE: -NewInference // TARGET_BACKEND: JVM // WITH_RUNTIME // FILE: genericSamProjectedOut.kt import example.SomeJavaClass -fun test(a: SomeJavaClass) { +fun test() { + var a: SomeJavaClass = SomeJavaClass() // a::someFunction parameter has type of Nothing // while it's completely safe to pass a lambda for a SAM // since Hello is effectively contravariant by its parameter @@ -12,6 +12,8 @@ fun test(a: SomeJavaClass) { a.someFunction {} a + {} a[{}] + a += {} + a[0] = {} } // FILE: example/Hello.java @@ -30,11 +32,16 @@ public class SomeJavaClass { ((Hello)hello).invoke("OK"); } - public void plus(Hello hello) { + public SomeJavaClass plus(Hello hello) { ((Hello)hello).invoke("OK"); + return this; } public void get(Hello hello) { ((Hello)hello).invoke("OK"); } + + public void set(int i, Hello hello) { + ((Hello)hello).invoke("OK"); + } } diff --git a/compiler/testData/ir/irText/expressions/sam/genericSamProjectedOut.kt.txt b/compiler/testData/ir/irText/expressions/sam/genericSamProjectedOut.kt.txt index ea5400af0f0..71001e33902 100644 --- a/compiler/testData/ir/irText/expressions/sam/genericSamProjectedOut.kt.txt +++ b/compiler/testData/ir/irText/expressions/sam/genericSamProjectedOut.kt.txt @@ -1,4 +1,5 @@ -fun test(a: SomeJavaClass) { +fun test() { + var a: SomeJavaClass = SomeJavaClass() a.someFunction(hello = local fun (it: @FlexibleNullability String?) { return Unit } @@ -6,9 +7,17 @@ fun test(a: SomeJavaClass) { a.plus(hello = local fun (it: @FlexibleNullability String?) { return Unit } - /*-> @FlexibleNullability Hello? */) + /*-> @FlexibleNullability Hello? */) /*~> Unit */ a.get(hello = local fun (it: @FlexibleNullability String?) { return Unit } /*-> @FlexibleNullability Hello? */) + a = a.plus(hello = local fun (it: @FlexibleNullability String?) { + return Unit + } + /*-> @FlexibleNullability Hello? */) /*!! SomeJavaClass */ + a.set(i = 0, hello = local fun (it: @FlexibleNullability String?) { + return Unit + } + /*-> @FlexibleNullability Hello? */) } diff --git a/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.ir.txt b/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.ir.txt index c99d235eca4..5def4e18d7c 100644 --- a/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.ir.txt +++ b/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.ir.txt @@ -1,21 +1,114 @@ FILE fqName: fileName:/samConversionInGenericConstructorCall.kt - FUN name:test1 visibility:public modality:FINAL <> (f:kotlin.Function1) returnType:.C<@[FlexibleNullability] kotlin.String?> - VALUE_PARAMETER name:f index:0 type:kotlin.Function1 + FUN name:test3 visibility:public modality:FINAL <> (f1:kotlin.Function1, f2:kotlin.Function1) returnType:.C.D<@[FlexibleNullability] kotlin.Int?, @[FlexibleNullability] kotlin.String?> + VALUE_PARAMETER name:f1 index:0 type:kotlin.Function1 + VALUE_PARAMETER name:f2 index:1 type:kotlin.Function1 BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test1 (f: kotlin.Function1): .C<@[FlexibleNullability] kotlin.String?> declared in ' - CONSTRUCTOR_CALL 'public constructor (jxx: @[FlexibleNullability] .J<@[FlexibleNullability] X of .C?, @[FlexibleNullability] X of .C?>?) declared in .C' type=.C<@[FlexibleNullability] kotlin.String?> origin=null - : @[FlexibleNullability] kotlin.String? - jxx: TYPE_OP type=@[FlexibleNullability] .J<@[FlexibleNullability] kotlin.String?, @[FlexibleNullability] kotlin.String?>? origin=SAM_CONVERSION typeOperand=@[FlexibleNullability] .J<@[FlexibleNullability] kotlin.String?, @[FlexibleNullability] kotlin.String?>? - GET_VAR 'f: kotlin.Function1 declared in .test1' type=kotlin.Function1 origin=null - FUN name:test2 visibility:public modality:FINAL <> (x:kotlin.Any) returnType:kotlin.Unit + RETURN type=kotlin.Nothing from='public final fun test3 (f1: kotlin.Function1, f2: kotlin.Function1): .C.D<@[FlexibleNullability] kotlin.Int?, @[FlexibleNullability] kotlin.String?> declared in ' + CONSTRUCTOR_CALL 'public constructor (jxy: @[FlexibleNullability] .J<@[FlexibleNullability] X of .C?, @[FlexibleNullability] Y of .C.D?>?) declared in .C.D' type=.C.D<@[FlexibleNullability] kotlin.Int?, @[FlexibleNullability] kotlin.String?> origin=null + : @[FlexibleNullability] kotlin.Int? + $outer: CONSTRUCTOR_CALL 'public constructor (jxx: @[FlexibleNullability] .J<@[FlexibleNullability] X of .C?, @[FlexibleNullability] X of .C?>?) declared in .C' type=.C<@[FlexibleNullability] kotlin.String?> origin=null + : @[FlexibleNullability] kotlin.String? + jxx: TYPE_OP type=@[FlexibleNullability] .J<@[FlexibleNullability] kotlin.String?, @[FlexibleNullability] kotlin.String?>? origin=SAM_CONVERSION typeOperand=@[FlexibleNullability] .J<@[FlexibleNullability] kotlin.String?, @[FlexibleNullability] kotlin.String?>? + GET_VAR 'f1: kotlin.Function1 declared in .test3' type=kotlin.Function1 origin=null + jxy: TYPE_OP type=@[FlexibleNullability] .J<@[FlexibleNullability] kotlin.String?, @[FlexibleNullability] kotlin.Int?>? origin=SAM_CONVERSION typeOperand=@[FlexibleNullability] .J<@[FlexibleNullability] kotlin.String?, @[FlexibleNullability] kotlin.Int?>? + GET_VAR 'f2: kotlin.Function1 declared in .test3' type=kotlin.Function1 origin=null + CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.Outer> + TYPE_PARAMETER name:T1 index:0 variance: superTypes:[kotlin.Any?] + CONSTRUCTOR visibility:public <> (j11:.J.Outer, T1 of .Outer>) returnType:.Outer.Outer> [primary] + VALUE_PARAMETER name:j11 index:0 type:.J.Outer, T1 of .Outer> + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:j11 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:j11 type:.J.Outer, T1 of .Outer> visibility:private [final] + EXPRESSION_BODY + GET_VAR 'j11: .J.Outer, T1 of .Outer> declared in .Outer.' type=.J.Outer, T1 of .Outer> origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Outer.Outer>) returnType:.J.Outer, T1 of .Outer> + correspondingProperty: PROPERTY name:j11 visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Outer.Outer> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): .J.Outer, T1 of .Outer> declared in .Outer' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:j11 type:.J.Outer, T1 of .Outer> visibility:private [final]' type=.J.Outer, T1 of .Outer> origin=null + receiver: GET_VAR ': .Outer.Outer> declared in .Outer.' type=.Outer.Outer> origin=null + CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.Inner.Outer.Inner, T1 of .Outer> + TYPE_PARAMETER name:T2 index:0 variance: superTypes:[kotlin.Any?] + CONSTRUCTOR visibility:public <> ($this:.Outer.Outer>, j12:.J.Outer, T2 of .Outer.Inner>) returnType:.Outer.Inner.Outer.Inner, T1 of .Outer> [primary] + $outer: VALUE_PARAMETER name: type:.Outer.Outer> + VALUE_PARAMETER name:j12 index:0 type:.J.Outer, T2 of .Outer.Inner> + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any]' + PROPERTY name:j12 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:j12 type:.J.Outer, T2 of .Outer.Inner> visibility:private [final] + EXPRESSION_BODY + GET_VAR 'j12: .J.Outer, T2 of .Outer.Inner> declared in .Outer.Inner.' type=.J.Outer, T2 of .Outer.Inner> origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Outer.Inner.Outer.Inner, T1 of .Outer>) returnType:.J.Outer, T2 of .Outer.Inner> + correspondingProperty: PROPERTY name:j12 visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Outer.Inner.Outer.Inner, T1 of .Outer> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): .J.Outer, T2 of .Outer.Inner> declared in .Outer.Inner' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:j12 type:.J.Outer, T2 of .Outer.Inner> visibility:private [final]' type=.J.Outer, T2 of .Outer.Inner> origin=null + receiver: GET_VAR ': .Outer.Inner.Outer.Inner, T1 of .Outer> declared in .Outer.Inner.' type=.Outer.Inner.Outer.Inner, T1 of .Outer> origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test4 visibility:public modality:FINAL <> (f:kotlin.Function1, g:kotlin.Function1) returnType:.Outer.Inner<@[FlexibleNullability] kotlin.Any?, @[FlexibleNullability] kotlin.String?> + VALUE_PARAMETER name:f index:0 type:kotlin.Function1 + VALUE_PARAMETER name:g index:1 type:kotlin.Function1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test4 (f: kotlin.Function1, g: kotlin.Function1): .Outer.Inner<@[FlexibleNullability] kotlin.Any?, @[FlexibleNullability] kotlin.String?> declared in ' + CONSTRUCTOR_CALL 'public constructor (j12: .J.Outer, T2 of .Outer.Inner>) [primary] declared in .Outer.Inner' type=.Outer.Inner<@[FlexibleNullability] kotlin.Any?, @[FlexibleNullability] kotlin.String?> origin=null + : @[FlexibleNullability] kotlin.Any? + $outer: CONSTRUCTOR_CALL 'public constructor (j11: .J.Outer, T1 of .Outer>) [primary] declared in .Outer' type=.Outer<@[FlexibleNullability] kotlin.String?> origin=null + : @[FlexibleNullability] kotlin.String? + j11: TYPE_OP type=.J<@[FlexibleNullability] kotlin.String?, @[FlexibleNullability] kotlin.String?> origin=SAM_CONVERSION typeOperand=.J<@[FlexibleNullability] kotlin.String?, @[FlexibleNullability] kotlin.String?> + GET_VAR 'f: kotlin.Function1 declared in .test4' type=kotlin.Function1 origin=null + j12: TYPE_OP type=.J<@[FlexibleNullability] kotlin.String?, @[FlexibleNullability] kotlin.Any?> origin=SAM_CONVERSION typeOperand=.J<@[FlexibleNullability] kotlin.String?, @[FlexibleNullability] kotlin.Any?> + GET_VAR 'g: kotlin.Function1 declared in .test4' type=kotlin.Function1 origin=null + FUN name:testGenericJavaCtor1 visibility:public modality:FINAL <> (f:kotlin.Function1) returnType:.G<@[FlexibleNullability] kotlin.String?> + VALUE_PARAMETER name:f index:0 type:kotlin.Function1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testGenericJavaCtor1 (f: kotlin.Function1): .G<@[FlexibleNullability] kotlin.String?> declared in ' + CONSTRUCTOR_CALL 'public constructor (x: @[FlexibleNullability] .J<@[FlexibleNullability] TCtor of .G.?, @[FlexibleNullability] TClass of .G?>?) declared in .G' type=.G<@[FlexibleNullability] kotlin.String?> origin=null + : @[FlexibleNullability] kotlin.String? + : @[FlexibleNullability] kotlin.Int? + x: TYPE_OP type=@[FlexibleNullability] .J<@[FlexibleNullability] kotlin.Int?, @[FlexibleNullability] kotlin.String?>? origin=SAM_CONVERSION typeOperand=@[FlexibleNullability] .J<@[FlexibleNullability] kotlin.Int?, @[FlexibleNullability] kotlin.String?>? + GET_VAR 'f: kotlin.Function1 declared in .testGenericJavaCtor1' type=kotlin.Function1 origin=null + FUN name:testGenericJavaCtor2 visibility:public modality:FINAL <> (x:kotlin.Any) returnType:kotlin.Unit VALUE_PARAMETER name:x index:0 type:kotlin.Any BLOCK_BODY TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - TYPE_OP type=kotlin.Function1 origin=CAST typeOperand=kotlin.Function1 - GET_VAR 'x: kotlin.Any declared in .test2' type=kotlin.Any origin=null + TYPE_OP type=kotlin.Function1 origin=CAST typeOperand=kotlin.Function1 + GET_VAR 'x: kotlin.Any declared in .testGenericJavaCtor2' type=kotlin.Any origin=null TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - CONSTRUCTOR_CALL 'public constructor (jxx: @[FlexibleNullability] .J<@[FlexibleNullability] X of .C?, @[FlexibleNullability] X of .C?>?) declared in .C' type=.C<@[FlexibleNullability] kotlin.String?> origin=null - : @[FlexibleNullability] kotlin.String? - jxx: TYPE_OP type=@[FlexibleNullability] .J<@[FlexibleNullability] kotlin.String?, @[FlexibleNullability] kotlin.String?>? origin=SAM_CONVERSION typeOperand=@[FlexibleNullability] .J<@[FlexibleNullability] kotlin.String?, @[FlexibleNullability] kotlin.String?>? - TYPE_OP type=kotlin.Function1 origin=IMPLICIT_CAST typeOperand=kotlin.Function1 - GET_VAR 'x: kotlin.Any declared in .test2' type=kotlin.Any origin=null + CONSTRUCTOR_CALL 'public constructor (x: @[FlexibleNullability] .J<@[FlexibleNullability] TCtor of .G.?, @[FlexibleNullability] TClass of .G?>?) declared in .G' type=.G<@[FlexibleNullability] kotlin.String?> origin=null + : @[FlexibleNullability] kotlin.String? + : @[FlexibleNullability] kotlin.Int? + x: TYPE_OP type=@[FlexibleNullability] .J<@[FlexibleNullability] kotlin.Int?, @[FlexibleNullability] kotlin.String?>? origin=SAM_CONVERSION typeOperand=@[FlexibleNullability] .J<@[FlexibleNullability] kotlin.Int?, @[FlexibleNullability] kotlin.String?>? + TYPE_OP type=kotlin.Function1 origin=IMPLICIT_CAST typeOperand=kotlin.Function1 + GET_VAR 'x: kotlin.Any declared in .testGenericJavaCtor2' type=kotlin.Any origin=null diff --git a/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.kt b/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.kt index f5405a26e6f..08561d0615a 100644 --- a/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.kt +++ b/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.kt @@ -1,12 +1,23 @@ // FIR_IDENTICAL // TARGET_BACKEND: JVM -// !LANGUAGE: +NewInference +SamConversionPerArgument +ProhibitVarargAsArrayAfterSamArgument // FILE: samConversionInGenericConstructorCall.kt -fun test1(f: (String) -> String) = C(f) +fun test3( + f1: (String) -> String, + f2: (Int) -> String +) = + C(f1).D(f2) -fun test2(x: Any) { - x as (String) -> String - C(x) +class Outer(val j11: J) { + inner class Inner(val j12: J) +} + +fun test4(f: (String) -> String, g: (Any) -> String) = Outer(f).Inner(g) + +fun testGenericJavaCtor1(f: (String) -> Int) = G(f) + +fun testGenericJavaCtor2(x: Any) { + x as (String) -> Int + G(x) } // FILE: J.java @@ -17,5 +28,13 @@ public interface J { // FILE: C.java public class C { public C(J jxx) {} + + public class D { + public D(J jxy) {} + } } +// FILE: G.java +public class G { + public G(J x) {} +} diff --git a/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.kt.txt b/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.kt.txt index 02cc97fefa3..19eb35d5b51 100644 --- a/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.kt.txt +++ b/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.kt.txt @@ -1,8 +1,42 @@ -fun test1(f: Function1): C<@FlexibleNullability String?> { - return C<@FlexibleNullability String?>(jxx = f /*-> @FlexibleNullability J<@FlexibleNullability String?, @FlexibleNullability String?>? */) +fun test3(f1: Function1, f2: Function1): D<@FlexibleNullability Int?, @FlexibleNullability String?> { + return C<@FlexibleNullability String?>(jxx = f1 /*-> @FlexibleNullability J<@FlexibleNullability String?, @FlexibleNullability String?>? */).D<@FlexibleNullability Int?>(jxy = f2 /*-> @FlexibleNullability J<@FlexibleNullability String?, @FlexibleNullability Int?>? */) } -fun test2(x: Any) { - x as Function1 /*~> Unit */ - C<@FlexibleNullability String?>(jxx = x /*as Function1 */ /*-> @FlexibleNullability J<@FlexibleNullability String?, @FlexibleNullability String?>? */) /*~> Unit */ +class Outer { + constructor(j11: J) /* primary */ { + super/*Any*/() + /* () */ + + } + + val j11: J + field = j11 + get + + inner class Inner { + constructor(j12: J) /* primary */ { + super/*Any*/() + /* () */ + + } + + val j12: J + field = j12 + get + + } + +} + +fun test4(f: Function1, g: Function1): Inner<@FlexibleNullability Any?, @FlexibleNullability String?> { + return Outer<@FlexibleNullability String?>(j11 = f /*-> J<@FlexibleNullability String?, @FlexibleNullability String?> */).Inner<@FlexibleNullability Any?>(j12 = g /*-> J<@FlexibleNullability String?, @FlexibleNullability Any?> */) +} + +fun testGenericJavaCtor1(f: Function1): G<@FlexibleNullability String?> { + return G<@FlexibleNullability String?, @FlexibleNullability Int?>(x = f /*-> @FlexibleNullability J<@FlexibleNullability Int?, @FlexibleNullability String?>? */) +} + +fun testGenericJavaCtor2(x: Any) { + x as Function1 /*~> Unit */ + G<@FlexibleNullability String?, @FlexibleNullability Int?>(x = x /*as Function1 */ /*-> @FlexibleNullability J<@FlexibleNullability Int?, @FlexibleNullability String?>? */) /*~> Unit */ } diff --git a/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall_NI.ir.txt b/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall_NI.ir.txt deleted file mode 100644 index 229419e46fa..00000000000 --- a/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall_NI.ir.txt +++ /dev/null @@ -1,114 +0,0 @@ -FILE fqName: fileName:/samConversionInGenericConstructorCall_NI.kt - FUN name:test3 visibility:public modality:FINAL <> (f1:kotlin.Function1, f2:kotlin.Function1) returnType:.C.D<@[FlexibleNullability] kotlin.Int?, @[FlexibleNullability] kotlin.String?> - VALUE_PARAMETER name:f1 index:0 type:kotlin.Function1 - VALUE_PARAMETER name:f2 index:1 type:kotlin.Function1 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test3 (f1: kotlin.Function1, f2: kotlin.Function1): .C.D<@[FlexibleNullability] kotlin.Int?, @[FlexibleNullability] kotlin.String?> declared in ' - CONSTRUCTOR_CALL 'public constructor (jxy: @[FlexibleNullability] .J<@[FlexibleNullability] X of .C?, @[FlexibleNullability] Y of .C.D?>?) declared in .C.D' type=.C.D<@[FlexibleNullability] kotlin.Int?, @[FlexibleNullability] kotlin.String?> origin=null - : @[FlexibleNullability] kotlin.Int? - $outer: CONSTRUCTOR_CALL 'public constructor (jxx: @[FlexibleNullability] .J<@[FlexibleNullability] X of .C?, @[FlexibleNullability] X of .C?>?) declared in .C' type=.C<@[FlexibleNullability] kotlin.String?> origin=null - : @[FlexibleNullability] kotlin.String? - jxx: TYPE_OP type=@[FlexibleNullability] .J<@[FlexibleNullability] kotlin.String?, @[FlexibleNullability] kotlin.String?>? origin=SAM_CONVERSION typeOperand=@[FlexibleNullability] .J<@[FlexibleNullability] kotlin.String?, @[FlexibleNullability] kotlin.String?>? - GET_VAR 'f1: kotlin.Function1 declared in .test3' type=kotlin.Function1 origin=null - jxy: TYPE_OP type=@[FlexibleNullability] .J<@[FlexibleNullability] kotlin.String?, @[FlexibleNullability] kotlin.Int?>? origin=SAM_CONVERSION typeOperand=@[FlexibleNullability] .J<@[FlexibleNullability] kotlin.String?, @[FlexibleNullability] kotlin.Int?>? - GET_VAR 'f2: kotlin.Function1 declared in .test3' type=kotlin.Function1 origin=null - CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.Outer> - TYPE_PARAMETER name:T1 index:0 variance: superTypes:[kotlin.Any?] - CONSTRUCTOR visibility:public <> (j11:.J.Outer, T1 of .Outer>) returnType:.Outer.Outer> [primary] - VALUE_PARAMETER name:j11 index:0 type:.J.Outer, T1 of .Outer> - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:j11 visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:j11 type:.J.Outer, T1 of .Outer> visibility:private [final] - EXPRESSION_BODY - GET_VAR 'j11: .J.Outer, T1 of .Outer> declared in .Outer.' type=.J.Outer, T1 of .Outer> origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Outer.Outer>) returnType:.J.Outer, T1 of .Outer> - correspondingProperty: PROPERTY name:j11 visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.Outer.Outer> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): .J.Outer, T1 of .Outer> declared in .Outer' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:j11 type:.J.Outer, T1 of .Outer> visibility:private [final]' type=.J.Outer, T1 of .Outer> origin=null - receiver: GET_VAR ': .Outer.Outer> declared in .Outer.' type=.Outer.Outer> origin=null - CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.Inner.Outer.Inner, T1 of .Outer> - TYPE_PARAMETER name:T2 index:0 variance: superTypes:[kotlin.Any?] - CONSTRUCTOR visibility:public <> ($this:.Outer.Outer>, j12:.J.Outer, T2 of .Outer.Inner>) returnType:.Outer.Inner.Outer.Inner, T1 of .Outer> [primary] - $outer: VALUE_PARAMETER name: type:.Outer.Outer> - VALUE_PARAMETER name:j12 index:0 type:.J.Outer, T2 of .Outer.Inner> - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any]' - PROPERTY name:j12 visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:j12 type:.J.Outer, T2 of .Outer.Inner> visibility:private [final] - EXPRESSION_BODY - GET_VAR 'j12: .J.Outer, T2 of .Outer.Inner> declared in .Outer.Inner.' type=.J.Outer, T2 of .Outer.Inner> origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Outer.Inner.Outer.Inner, T1 of .Outer>) returnType:.J.Outer, T2 of .Outer.Inner> - correspondingProperty: PROPERTY name:j12 visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.Outer.Inner.Outer.Inner, T1 of .Outer> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): .J.Outer, T2 of .Outer.Inner> declared in .Outer.Inner' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:j12 type:.J.Outer, T2 of .Outer.Inner> visibility:private [final]' type=.J.Outer, T2 of .Outer.Inner> origin=null - receiver: GET_VAR ': .Outer.Inner.Outer.Inner, T1 of .Outer> declared in .Outer.Inner.' type=.Outer.Inner.Outer.Inner, T1 of .Outer> origin=null - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:test4 visibility:public modality:FINAL <> (f:kotlin.Function1, g:kotlin.Function1) returnType:.Outer.Inner<@[FlexibleNullability] kotlin.Any?, @[FlexibleNullability] kotlin.String?> - VALUE_PARAMETER name:f index:0 type:kotlin.Function1 - VALUE_PARAMETER name:g index:1 type:kotlin.Function1 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test4 (f: kotlin.Function1, g: kotlin.Function1): .Outer.Inner<@[FlexibleNullability] kotlin.Any?, @[FlexibleNullability] kotlin.String?> declared in ' - CONSTRUCTOR_CALL 'public constructor (j12: .J.Outer, T2 of .Outer.Inner>) [primary] declared in .Outer.Inner' type=.Outer.Inner<@[FlexibleNullability] kotlin.Any?, @[FlexibleNullability] kotlin.String?> origin=null - : @[FlexibleNullability] kotlin.Any? - $outer: CONSTRUCTOR_CALL 'public constructor (j11: .J.Outer, T1 of .Outer>) [primary] declared in .Outer' type=.Outer<@[FlexibleNullability] kotlin.String?> origin=null - : @[FlexibleNullability] kotlin.String? - j11: TYPE_OP type=.J<@[FlexibleNullability] kotlin.String?, @[FlexibleNullability] kotlin.String?> origin=SAM_CONVERSION typeOperand=.J<@[FlexibleNullability] kotlin.String?, @[FlexibleNullability] kotlin.String?> - GET_VAR 'f: kotlin.Function1 declared in .test4' type=kotlin.Function1 origin=null - j12: TYPE_OP type=.J<@[FlexibleNullability] kotlin.String?, @[FlexibleNullability] kotlin.Any?> origin=SAM_CONVERSION typeOperand=.J<@[FlexibleNullability] kotlin.String?, @[FlexibleNullability] kotlin.Any?> - GET_VAR 'g: kotlin.Function1 declared in .test4' type=kotlin.Function1 origin=null - FUN name:testGenericJavaCtor1 visibility:public modality:FINAL <> (f:kotlin.Function1) returnType:.G<@[FlexibleNullability] kotlin.String?> - VALUE_PARAMETER name:f index:0 type:kotlin.Function1 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testGenericJavaCtor1 (f: kotlin.Function1): .G<@[FlexibleNullability] kotlin.String?> declared in ' - CONSTRUCTOR_CALL 'public constructor (x: @[FlexibleNullability] .J<@[FlexibleNullability] TCtor of .G.?, @[FlexibleNullability] TClass of .G?>?) declared in .G' type=.G<@[FlexibleNullability] kotlin.String?> origin=null - : @[FlexibleNullability] kotlin.String? - : @[FlexibleNullability] kotlin.Int? - x: TYPE_OP type=@[FlexibleNullability] .J<@[FlexibleNullability] kotlin.Int?, @[FlexibleNullability] kotlin.String?>? origin=SAM_CONVERSION typeOperand=@[FlexibleNullability] .J<@[FlexibleNullability] kotlin.Int?, @[FlexibleNullability] kotlin.String?>? - GET_VAR 'f: kotlin.Function1 declared in .testGenericJavaCtor1' type=kotlin.Function1 origin=null - FUN name:testGenericJavaCtor2 visibility:public modality:FINAL <> (x:kotlin.Any) returnType:kotlin.Unit - VALUE_PARAMETER name:x index:0 type:kotlin.Any - BLOCK_BODY - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - TYPE_OP type=kotlin.Function1 origin=CAST typeOperand=kotlin.Function1 - GET_VAR 'x: kotlin.Any declared in .testGenericJavaCtor2' type=kotlin.Any origin=null - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - CONSTRUCTOR_CALL 'public constructor (x: @[FlexibleNullability] .J<@[FlexibleNullability] TCtor of .G.?, @[FlexibleNullability] TClass of .G?>?) declared in .G' type=.G<@[FlexibleNullability] kotlin.String?> origin=null - : @[FlexibleNullability] kotlin.String? - : @[FlexibleNullability] kotlin.Int? - x: TYPE_OP type=@[FlexibleNullability] .J<@[FlexibleNullability] kotlin.Int?, @[FlexibleNullability] kotlin.String?>? origin=SAM_CONVERSION typeOperand=@[FlexibleNullability] .J<@[FlexibleNullability] kotlin.Int?, @[FlexibleNullability] kotlin.String?>? - TYPE_OP type=kotlin.Function1 origin=IMPLICIT_CAST typeOperand=kotlin.Function1 - GET_VAR 'x: kotlin.Any declared in .testGenericJavaCtor2' type=kotlin.Any origin=null diff --git a/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall_NI.kt b/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall_NI.kt deleted file mode 100644 index ab9871f9ff8..00000000000 --- a/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall_NI.kt +++ /dev/null @@ -1,41 +0,0 @@ -// FIR_IDENTICAL -// TARGET_BACKEND: JVM -// !LANGUAGE: +NewInference +SamConversionPerArgument +SamConversionForKotlinFunctions +ProhibitVarargAsArrayAfterSamArgument -// FILE: samConversionInGenericConstructorCall_NI.kt -fun test3( - f1: (String) -> String, - f2: (Int) -> String -) = - C(f1).D(f2) - -class Outer(val j11: J) { - inner class Inner(val j12: J) -} - -fun test4(f: (String) -> String, g: (Any) -> String) = Outer(f).Inner(g) - -fun testGenericJavaCtor1(f: (String) -> Int) = G(f) - -fun testGenericJavaCtor2(x: Any) { - x as (String) -> Int - G(x) -} - -// FILE: J.java -public interface J { - T1 foo(T2 x); -} - -// FILE: C.java -public class C { - public C(J jxx) {} - - public class D { - public D(J jxy) {} - } -} - -// FILE: G.java -public class G { - public G(J x) {} -} diff --git a/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall_NI.kt.txt b/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall_NI.kt.txt deleted file mode 100644 index 19eb35d5b51..00000000000 --- a/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall_NI.kt.txt +++ /dev/null @@ -1,42 +0,0 @@ -fun test3(f1: Function1, f2: Function1): D<@FlexibleNullability Int?, @FlexibleNullability String?> { - return C<@FlexibleNullability String?>(jxx = f1 /*-> @FlexibleNullability J<@FlexibleNullability String?, @FlexibleNullability String?>? */).D<@FlexibleNullability Int?>(jxy = f2 /*-> @FlexibleNullability J<@FlexibleNullability String?, @FlexibleNullability Int?>? */) -} - -class Outer { - constructor(j11: J) /* primary */ { - super/*Any*/() - /* () */ - - } - - val j11: J - field = j11 - get - - inner class Inner { - constructor(j12: J) /* primary */ { - super/*Any*/() - /* () */ - - } - - val j12: J - field = j12 - get - - } - -} - -fun test4(f: Function1, g: Function1): Inner<@FlexibleNullability Any?, @FlexibleNullability String?> { - return Outer<@FlexibleNullability String?>(j11 = f /*-> J<@FlexibleNullability String?, @FlexibleNullability String?> */).Inner<@FlexibleNullability Any?>(j12 = g /*-> J<@FlexibleNullability String?, @FlexibleNullability Any?> */) -} - -fun testGenericJavaCtor1(f: Function1): G<@FlexibleNullability String?> { - return G<@FlexibleNullability String?, @FlexibleNullability Int?>(x = f /*-> @FlexibleNullability J<@FlexibleNullability Int?, @FlexibleNullability String?>? */) -} - -fun testGenericJavaCtor2(x: Any) { - x as Function1 /*~> Unit */ - G<@FlexibleNullability String?, @FlexibleNullability Int?>(x = x /*as Function1 */ /*-> @FlexibleNullability J<@FlexibleNullability Int?, @FlexibleNullability String?>? */) /*~> Unit */ -} diff --git a/compiler/testData/ir/irText/expressions/sam/samConversionsWithSmartCasts.ir.txt b/compiler/testData/ir/irText/expressions/sam/samConversionsWithSmartCasts.ir.txt index 4c3e145d580..90f46390c80 100644 --- a/compiler/testData/ir/irText/expressions/sam/samConversionsWithSmartCasts.ir.txt +++ b/compiler/testData/ir/irText/expressions/sam/samConversionsWithSmartCasts.ir.txt @@ -47,7 +47,7 @@ FILE fqName: fileName:/samConversionsWithSmartCasts.kt then: BLOCK type=kotlin.Unit origin=null CALL 'public open fun run2 (r1: @[FlexibleNullability] java.lang.Runnable?, r2: @[FlexibleNullability] java.lang.Runnable?): kotlin.Unit declared in .J' type=kotlin.Unit origin=null $this: CONSTRUCTOR_CALL 'public constructor () [primary] declared in .J' type=.J origin=null - r1: TYPE_OP type=@[FlexibleNullability] java.lang.Runnable? origin=SAM_CONVERSION typeOperand=@[FlexibleNullability] java.lang.Runnable? + r1: TYPE_OP type=java.lang.Runnable origin=IMPLICIT_CAST typeOperand=java.lang.Runnable GET_VAR 'a: kotlin.Function0 declared in .test4' type=kotlin.Function0 origin=null r2: TYPE_OP type=@[FlexibleNullability] java.lang.Runnable? origin=SAM_CONVERSION typeOperand=@[FlexibleNullability] java.lang.Runnable? GET_VAR 'b: kotlin.Function0 declared in .test4' type=kotlin.Function0 origin=null diff --git a/compiler/testData/ir/irText/expressions/sam/samConversionsWithSmartCasts.kt b/compiler/testData/ir/irText/expressions/sam/samConversionsWithSmartCasts.kt index 5ce8f89a925..808f5a0799a 100644 --- a/compiler/testData/ir/irText/expressions/sam/samConversionsWithSmartCasts.kt +++ b/compiler/testData/ir/irText/expressions/sam/samConversionsWithSmartCasts.kt @@ -1,7 +1,4 @@ -// !LANGUAGE: -NewInference // TARGET_BACKEND: JVM -// NB new inference doesn't really work with old JVM back-end. - // WITH_JDK // FILE: samConversionsWithSmartCasts.kt @@ -69,4 +66,4 @@ public class J { public void run2(Runnable r1, Runnable r2) {} public static T id(T x) { return x; } -} \ No newline at end of file +} diff --git a/compiler/testData/ir/irText/expressions/sam/samConversionsWithSmartCasts.kt.txt b/compiler/testData/ir/irText/expressions/sam/samConversionsWithSmartCasts.kt.txt index 21a80657a37..c0b64824632 100644 --- a/compiler/testData/ir/irText/expressions/sam/samConversionsWithSmartCasts.kt.txt +++ b/compiler/testData/ir/irText/expressions/sam/samConversionsWithSmartCasts.kt.txt @@ -25,7 +25,7 @@ fun test3(a: Function0) { fun test4(a: Function0, b: Function0) { when { a is Runnable -> { // BLOCK - J().run2(r1 = a /*-> @FlexibleNullability Runnable? */, r2 = b /*-> @FlexibleNullability Runnable? */) + J().run2(r1 = a /*as Runnable */, r2 = b /*-> @FlexibleNullability Runnable? */) } } } diff --git a/compiler/testData/ir/irText/expressions/variableAsFunctionCallWithGenerics.kt b/compiler/testData/ir/irText/expressions/variableAsFunctionCallWithGenerics.kt index 25cff35826b..77bb9ae2412 100644 --- a/compiler/testData/ir/irText/expressions/variableAsFunctionCallWithGenerics.kt +++ b/compiler/testData/ir/irText/expressions/variableAsFunctionCallWithGenerics.kt @@ -1,5 +1,3 @@ -// !LANGUAGE: +NewInference - val T.gk: () -> T get() = { -> this } @@ -8,4 +6,4 @@ fun testGeneric1(x: String) = x.gk() val T.kt26531Val: () -> T get() = fun () = this -fun kt26531() = 7.kt26531Val() \ No newline at end of file +fun kt26531() = 7.kt26531Val() diff --git a/compiler/testData/ir/irText/regressions/newInference/fixationOrder1.ir.txt b/compiler/testData/ir/irText/regressions/newInferenceFixationOrder1.ir.txt similarity index 98% rename from compiler/testData/ir/irText/regressions/newInference/fixationOrder1.ir.txt rename to compiler/testData/ir/irText/regressions/newInferenceFixationOrder1.ir.txt index 6367b2e0687..41f4e9a21fe 100644 --- a/compiler/testData/ir/irText/regressions/newInference/fixationOrder1.ir.txt +++ b/compiler/testData/ir/irText/regressions/newInferenceFixationOrder1.ir.txt @@ -1,4 +1,4 @@ -FILE fqName: fileName:/fixationOrder1.kt +FILE fqName: fileName:/newInferenceFixationOrder1.kt FUN name:foo visibility:public modality:FINAL () returnType:kotlin.Function1.foo, Y of .foo> TYPE_PARAMETER name:X index:0 variance: superTypes:[kotlin.Any?] TYPE_PARAMETER name:Y index:1 variance: superTypes:[kotlin.Any?] diff --git a/compiler/testData/ir/irText/regressions/newInference/fixationOrder1.kt b/compiler/testData/ir/irText/regressions/newInferenceFixationOrder1.kt similarity index 100% rename from compiler/testData/ir/irText/regressions/newInference/fixationOrder1.kt rename to compiler/testData/ir/irText/regressions/newInferenceFixationOrder1.kt diff --git a/compiler/testData/ir/irText/regressions/newInference/fixationOrder1.kt.txt b/compiler/testData/ir/irText/regressions/newInferenceFixationOrder1.kt.txt similarity index 100% rename from compiler/testData/ir/irText/regressions/newInference/fixationOrder1.kt.txt rename to compiler/testData/ir/irText/regressions/newInferenceFixationOrder1.kt.txt diff --git a/compiler/testData/ir/irText/types/castsInsideCoroutineInference.kt b/compiler/testData/ir/irText/types/castsInsideCoroutineInference.kt index d308f898f3c..0d179c3c81f 100644 --- a/compiler/testData/ir/irText/types/castsInsideCoroutineInference.kt +++ b/compiler/testData/ir/irText/types/castsInsideCoroutineInference.kt @@ -1,9 +1,7 @@ -// !LANGUAGE: +NewInference // WITH_RUNTIME import kotlin.experimental.ExperimentalTypeInference - @OptIn(ExperimentalTypeInference::class) fun scopedFlow(@BuilderInference block: suspend CoroutineScope.(FlowCollector) -> Unit): Flow = flow { diff --git a/compiler/testData/ir/irText/types/coercionToUnitInLambdaReturnValue.kt b/compiler/testData/ir/irText/types/coercionToUnitInLambdaReturnValue.kt index 629ea394959..c26bc951a58 100644 --- a/compiler/testData/ir/irText/types/coercionToUnitInLambdaReturnValue.kt +++ b/compiler/testData/ir/irText/types/coercionToUnitInLambdaReturnValue.kt @@ -1,8 +1,7 @@ // FIR_IDENTICAL -// !LANGUAGE: +NewInference fun use(fn: () -> Unit) {} fun test() { use { 42 } -} \ No newline at end of file +} diff --git a/compiler/testData/ir/irText/types/inStarProjectionInReceiverType.kt b/compiler/testData/ir/irText/types/inStarProjectionInReceiverType.kt index cf59c7581c1..e013417ba73 100644 --- a/compiler/testData/ir/irText/types/inStarProjectionInReceiverType.kt +++ b/compiler/testData/ir/irText/types/inStarProjectionInReceiverType.kt @@ -1,5 +1,4 @@ // FIR_IDENTICAL -// !LANGUAGE: +NewInference interface Foo { val x: Int @@ -13,4 +12,4 @@ fun Foo<*>.testSmartCastOnExtensionReceiver() { foo("string") } -fun testValueParameter(vp: Foo<*>) = vp.x \ No newline at end of file +fun testValueParameter(vp: Foo<*>) = vp.x diff --git a/compiler/testData/ir/irText/types/intersectionType1_NI.fir.ir.txt b/compiler/testData/ir/irText/types/intersectionType1.fir.ir.txt similarity index 99% rename from compiler/testData/ir/irText/types/intersectionType1_NI.fir.ir.txt rename to compiler/testData/ir/irText/types/intersectionType1.fir.ir.txt index fb21ecf5370..c4240b3245e 100644 --- a/compiler/testData/ir/irText/types/intersectionType1_NI.fir.ir.txt +++ b/compiler/testData/ir/irText/types/intersectionType1.fir.ir.txt @@ -1,4 +1,4 @@ -FILE fqName: fileName:/intersectionType1_NI.kt +FILE fqName: fileName:/intersectionType1.kt CLASS CLASS name:In modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.In.In> TYPE_PARAMETER name:I index:0 variance:in superTypes:[kotlin.Any?] diff --git a/compiler/testData/ir/irText/types/intersectionType1_NI.fir.kt.txt b/compiler/testData/ir/irText/types/intersectionType1.fir.kt.txt similarity index 100% rename from compiler/testData/ir/irText/types/intersectionType1_NI.fir.kt.txt rename to compiler/testData/ir/irText/types/intersectionType1.fir.kt.txt diff --git a/compiler/testData/ir/irText/types/intersectionType1_NI.ir.txt b/compiler/testData/ir/irText/types/intersectionType1.ir.txt similarity index 99% rename from compiler/testData/ir/irText/types/intersectionType1_NI.ir.txt rename to compiler/testData/ir/irText/types/intersectionType1.ir.txt index 990165170a8..c16ca024d7d 100644 --- a/compiler/testData/ir/irText/types/intersectionType1_NI.ir.txt +++ b/compiler/testData/ir/irText/types/intersectionType1.ir.txt @@ -1,4 +1,4 @@ -FILE fqName: fileName:/intersectionType1_NI.kt +FILE fqName: fileName:/intersectionType1.kt CLASS CLASS name:In modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.In.In> TYPE_PARAMETER name:I index:0 variance:in superTypes:[kotlin.Any?] diff --git a/compiler/testData/ir/irText/types/intersectionType1_NI.kt b/compiler/testData/ir/irText/types/intersectionType1.kt similarity index 90% rename from compiler/testData/ir/irText/types/intersectionType1_NI.kt rename to compiler/testData/ir/irText/types/intersectionType1.kt index e5b52fa4efa..8e9ae4a0244 100644 --- a/compiler/testData/ir/irText/types/intersectionType1_NI.kt +++ b/compiler/testData/ir/irText/types/intersectionType1.kt @@ -1,5 +1,3 @@ -// !LANGUAGE: +NewInference - class In fun select(x: S, y: S): S = x @@ -14,4 +12,4 @@ fun test() { val a1 = arrayOf(In()) val a2 = arrayOf(In()) foo(a1, a2) -} \ No newline at end of file +} diff --git a/compiler/testData/ir/irText/types/intersectionType1_NI.kt.txt b/compiler/testData/ir/irText/types/intersectionType1.kt.txt similarity index 100% rename from compiler/testData/ir/irText/types/intersectionType1_NI.kt.txt rename to compiler/testData/ir/irText/types/intersectionType1.kt.txt diff --git a/compiler/testData/ir/irText/types/intersectionType1_OI.fir.ir.txt b/compiler/testData/ir/irText/types/intersectionType1_OI.fir.ir.txt deleted file mode 100644 index f168821a086..00000000000 --- a/compiler/testData/ir/irText/types/intersectionType1_OI.fir.ir.txt +++ /dev/null @@ -1,70 +0,0 @@ -FILE fqName: fileName:/intersectionType1_OI.kt - CLASS CLASS name:In modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.In.In> - TYPE_PARAMETER name:I index:0 variance:in superTypes:[kotlin.Any?] - CONSTRUCTOR visibility:public <> () returnType:.In.In> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:In modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:select visibility:public modality:FINAL (x:S of .select, y:S of .select) returnType:S of .select - TYPE_PARAMETER name:S index:0 variance: superTypes:[kotlin.Any?] - VALUE_PARAMETER name:x index:0 type:S of .select - VALUE_PARAMETER name:y index:1 type:S of .select - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun select (x: S of .select, y: S of .select): S of .select declared in ' - GET_VAR 'x: S of .select declared in .select' type=S of .select origin=null - FUN name:foo visibility:public modality:FINAL (a:kotlin.Array<.In.foo>>, b:kotlin.Array<.In>) returnType:kotlin.Boolean - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] - VALUE_PARAMETER name:a index:0 type:kotlin.Array<.In.foo>> - VALUE_PARAMETER name:b index:1 type:kotlin.Array<.In> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun foo (a: kotlin.Array<.In.foo>>, b: kotlin.Array<.In>): kotlin.Boolean declared in ' - CALL 'public final fun ofType (y: kotlin.Any?): kotlin.Boolean [inline] declared in ' type=kotlin.Boolean origin=null - : kotlin.Any? - $receiver: CALL 'public final fun get (index: kotlin.Int): T of kotlin.Array [operator] declared in kotlin.Array' type=.In origin=null - $this: CALL 'public final fun select (x: S of .select, y: S of .select): S of .select declared in ' type=kotlin.Array.In> origin=null - : kotlin.Array.In> - x: GET_VAR 'a: kotlin.Array<.In.foo>> declared in .foo' type=kotlin.Array<.In.foo>> origin=null - y: GET_VAR 'b: kotlin.Array<.In> declared in .foo' type=kotlin.Array<.In> origin=null - index: CONST Int type=kotlin.Int value=0 - y: CONST Boolean type=kotlin.Boolean value=true - FUN name:ofType visibility:public modality:FINAL ($receiver:.In.ofType>, y:kotlin.Any?) returnType:kotlin.Boolean [inline] - TYPE_PARAMETER name:K index:0 variance: superTypes:[kotlin.Any?] - $receiver: VALUE_PARAMETER name: type:.In.ofType> - VALUE_PARAMETER name:y index:0 type:kotlin.Any? - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun ofType (y: kotlin.Any?): kotlin.Boolean [inline] declared in ' - TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=K of .ofType - GET_VAR 'y: kotlin.Any? declared in .ofType' type=kotlin.Any? origin=null - FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - VAR name:a1 type:kotlin.Array<.In> [val] - CALL 'public final fun arrayOf (vararg elements: T of kotlin.arrayOf): kotlin.Array [inline] declared in kotlin' type=kotlin.Array<.In> origin=null - : .In - elements: VARARG type=kotlin.Array.In> varargElementType=.In - CONSTRUCTOR_CALL 'public constructor () [primary] declared in .In' type=.In origin=null - : kotlin.Int - VAR name:a2 type:kotlin.Array<.In> [val] - CALL 'public final fun arrayOf (vararg elements: T of kotlin.arrayOf): kotlin.Array [inline] declared in kotlin' type=kotlin.Array<.In> origin=null - : .In - elements: VARARG type=kotlin.Array.In> varargElementType=.In - CONSTRUCTOR_CALL 'public constructor () [primary] declared in .In' type=.In origin=null - : kotlin.String - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - CALL 'public final fun foo (a: kotlin.Array<.In.foo>>, b: kotlin.Array<.In>): kotlin.Boolean declared in ' type=kotlin.Boolean origin=null - : kotlin.Int - a: GET_VAR 'val a1: kotlin.Array<.In> [val] declared in .test' type=kotlin.Array<.In> origin=null - b: GET_VAR 'val a2: kotlin.Array<.In> [val] declared in .test' type=kotlin.Array<.In> origin=null diff --git a/compiler/testData/ir/irText/types/intersectionType1_OI.fir.kt.txt b/compiler/testData/ir/irText/types/intersectionType1_OI.fir.kt.txt deleted file mode 100644 index a0bda919653..00000000000 --- a/compiler/testData/ir/irText/types/intersectionType1_OI.fir.kt.txt +++ /dev/null @@ -1,26 +0,0 @@ -class In { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - -} - -fun select(x: S, y: S): S { - return x -} - -fun foo(a: Array>, b: Array>): Boolean { - return select>>(x = a, y = b).get(index = 0).ofType(y = true) -} - -inline fun In.ofType(y: Any?): Boolean { - return y is K -} - -fun test() { - val a1: Array> = arrayOf>(elements = [In()]) - val a2: Array> = arrayOf>(elements = [In()]) - foo(a = a1, b = a2) /*~> Unit */ -} diff --git a/compiler/testData/ir/irText/types/intersectionType1_OI.ir.txt b/compiler/testData/ir/irText/types/intersectionType1_OI.ir.txt deleted file mode 100644 index bdf52bbf75d..00000000000 --- a/compiler/testData/ir/irText/types/intersectionType1_OI.ir.txt +++ /dev/null @@ -1,70 +0,0 @@ -FILE fqName: fileName:/intersectionType1_OI.kt - CLASS CLASS name:In modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.In.In> - TYPE_PARAMETER name:I index:0 variance:in superTypes:[kotlin.Any?] - CONSTRUCTOR visibility:public <> () returnType:.In.In> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:In modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:select visibility:public modality:FINAL (x:S of .select, y:S of .select) returnType:S of .select - TYPE_PARAMETER name:S index:0 variance: superTypes:[kotlin.Any?] - VALUE_PARAMETER name:x index:0 type:S of .select - VALUE_PARAMETER name:y index:1 type:S of .select - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun select (x: S of .select, y: S of .select): S of .select declared in ' - GET_VAR 'x: S of .select declared in .select' type=S of .select origin=null - FUN name:foo visibility:public modality:FINAL (a:kotlin.Array<.In.foo>>, b:kotlin.Array<.In>) returnType:kotlin.Boolean - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] - VALUE_PARAMETER name:a index:0 type:kotlin.Array<.In.foo>> - VALUE_PARAMETER name:b index:1 type:kotlin.Array<.In> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun foo (a: kotlin.Array<.In.foo>>, b: kotlin.Array<.In>): kotlin.Boolean declared in ' - CALL 'public final fun ofType (y: kotlin.Any?): kotlin.Boolean [inline] declared in ' type=kotlin.Boolean origin=null - : kotlin.Any? - $receiver: CALL 'public final fun get (index: kotlin.Int): T of kotlin.Array [operator] declared in kotlin.Array' type=.In origin=GET_ARRAY_ELEMENT - $this: CALL 'public final fun select (x: S of .select, y: S of .select): S of .select declared in ' type=kotlin.Array.In> origin=null - : kotlin.Array.In> - x: GET_VAR 'a: kotlin.Array<.In.foo>> declared in .foo' type=kotlin.Array<.In.foo>> origin=null - y: GET_VAR 'b: kotlin.Array<.In> declared in .foo' type=kotlin.Array<.In> origin=null - index: CONST Int type=kotlin.Int value=0 - y: CONST Boolean type=kotlin.Boolean value=true - FUN name:ofType visibility:public modality:FINAL ($receiver:.In.ofType>, y:kotlin.Any?) returnType:kotlin.Boolean [inline] - TYPE_PARAMETER name:K index:0 variance: superTypes:[kotlin.Any?] - $receiver: VALUE_PARAMETER name: type:.In.ofType> - VALUE_PARAMETER name:y index:0 type:kotlin.Any? - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun ofType (y: kotlin.Any?): kotlin.Boolean [inline] declared in ' - TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=K of .ofType - GET_VAR 'y: kotlin.Any? declared in .ofType' type=kotlin.Any? origin=null - FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - VAR name:a1 type:kotlin.Array<.In> [val] - CALL 'public final fun arrayOf (vararg elements: T of kotlin.arrayOf): kotlin.Array [inline] declared in kotlin' type=kotlin.Array<.In> origin=null - : .In - elements: VARARG type=kotlin.Array.In> varargElementType=.In - CONSTRUCTOR_CALL 'public constructor () [primary] declared in .In' type=.In origin=null - : kotlin.Int - VAR name:a2 type:kotlin.Array<.In> [val] - CALL 'public final fun arrayOf (vararg elements: T of kotlin.arrayOf): kotlin.Array [inline] declared in kotlin' type=kotlin.Array<.In> origin=null - : .In - elements: VARARG type=kotlin.Array.In> varargElementType=.In - CONSTRUCTOR_CALL 'public constructor () [primary] declared in .In' type=.In origin=null - : kotlin.String - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - CALL 'public final fun foo (a: kotlin.Array<.In.foo>>, b: kotlin.Array<.In>): kotlin.Boolean declared in ' type=kotlin.Boolean origin=null - : kotlin.Int - a: GET_VAR 'val a1: kotlin.Array<.In> [val] declared in .test' type=kotlin.Array<.In> origin=null - b: GET_VAR 'val a2: kotlin.Array<.In> [val] declared in .test' type=kotlin.Array<.In> origin=null diff --git a/compiler/testData/ir/irText/types/intersectionType1_OI.kt b/compiler/testData/ir/irText/types/intersectionType1_OI.kt deleted file mode 100644 index 5c29c62b904..00000000000 --- a/compiler/testData/ir/irText/types/intersectionType1_OI.kt +++ /dev/null @@ -1,17 +0,0 @@ -// !LANGUAGE: -NewInference - -class In - -fun select(x: S, y: S): S = x - -fun foo(a: Array>, b: Array>) = - select(a, b)[0].ofType(true) - -inline fun In.ofType(y: Any?) = - y is K - -fun test() { - val a1 = arrayOf(In()) - val a2 = arrayOf(In()) - foo(a1, a2) -} \ No newline at end of file diff --git a/compiler/testData/ir/irText/types/intersectionType1_OI.kt.txt b/compiler/testData/ir/irText/types/intersectionType1_OI.kt.txt deleted file mode 100644 index e92ae81955b..00000000000 --- a/compiler/testData/ir/irText/types/intersectionType1_OI.kt.txt +++ /dev/null @@ -1,26 +0,0 @@ -class In { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - -} - -fun select(x: S, y: S): S { - return x -} - -fun foo(a: Array>, b: Array>): Boolean { - return select>>(x = a, y = b).get(index = 0).ofType(y = true) -} - -inline fun In.ofType(y: Any?): Boolean { - return y is K -} - -fun test() { - val a1: Array> = arrayOf>(elements = [In()]) - val a2: Array> = arrayOf>(elements = [In()]) - foo(a = a1, b = a2) /*~> Unit */ -} diff --git a/compiler/testData/ir/irText/types/intersectionType2_NI.fir.ir.txt b/compiler/testData/ir/irText/types/intersectionType2.fir.ir.txt similarity index 99% rename from compiler/testData/ir/irText/types/intersectionType2_NI.fir.ir.txt rename to compiler/testData/ir/irText/types/intersectionType2.fir.ir.txt index 5207e2b8f0f..33391337924 100644 --- a/compiler/testData/ir/irText/types/intersectionType2_NI.fir.ir.txt +++ b/compiler/testData/ir/irText/types/intersectionType2.fir.ir.txt @@ -1,4 +1,4 @@ -FILE fqName: fileName:/intersectionType2_NI.kt +FILE fqName: fileName:/intersectionType2.kt CLASS INTERFACE name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A.A> TYPE_PARAMETER name:T index:0 variance:out superTypes:[kotlin.Any?] diff --git a/compiler/testData/ir/irText/types/intersectionType2_NI.fir.kt.txt b/compiler/testData/ir/irText/types/intersectionType2.fir.kt.txt similarity index 100% rename from compiler/testData/ir/irText/types/intersectionType2_NI.fir.kt.txt rename to compiler/testData/ir/irText/types/intersectionType2.fir.kt.txt diff --git a/compiler/testData/ir/irText/types/intersectionType2_NI.ir.txt b/compiler/testData/ir/irText/types/intersectionType2.ir.txt similarity index 99% rename from compiler/testData/ir/irText/types/intersectionType2_NI.ir.txt rename to compiler/testData/ir/irText/types/intersectionType2.ir.txt index 304c7be7915..4709b7ef63e 100644 --- a/compiler/testData/ir/irText/types/intersectionType2_NI.ir.txt +++ b/compiler/testData/ir/irText/types/intersectionType2.ir.txt @@ -1,4 +1,4 @@ -FILE fqName: fileName:/intersectionType2_NI.kt +FILE fqName: fileName:/intersectionType2.kt CLASS INTERFACE name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A.A> TYPE_PARAMETER name:T index:0 variance:out superTypes:[kotlin.Any?] diff --git a/compiler/testData/ir/irText/types/intersectionType2_NI.kt b/compiler/testData/ir/irText/types/intersectionType2.kt similarity index 87% rename from compiler/testData/ir/irText/types/intersectionType2_NI.kt rename to compiler/testData/ir/irText/types/intersectionType2.kt index ab259f9e1dd..62876866d30 100644 --- a/compiler/testData/ir/irText/types/intersectionType2_NI.kt +++ b/compiler/testData/ir/irText/types/intersectionType2.kt @@ -1,5 +1,3 @@ -// !LANGUAGE: +NewInference - interface A interface Foo @@ -15,4 +13,4 @@ fun foo() = run { val c = if (true) mm else nn c -} \ No newline at end of file +} diff --git a/compiler/testData/ir/irText/types/intersectionType2_NI.kt.txt b/compiler/testData/ir/irText/types/intersectionType2.kt.txt similarity index 100% rename from compiler/testData/ir/irText/types/intersectionType2_NI.kt.txt rename to compiler/testData/ir/irText/types/intersectionType2.kt.txt diff --git a/compiler/testData/ir/irText/types/intersectionType2_OI.fir.ir.txt b/compiler/testData/ir/irText/types/intersectionType2_OI.fir.ir.txt deleted file mode 100644 index 241cb76ca7f..00000000000 --- a/compiler/testData/ir/irText/types/intersectionType2_OI.fir.ir.txt +++ /dev/null @@ -1,105 +0,0 @@ -FILE fqName: fileName:/intersectionType2_OI.kt - CLASS INTERFACE name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A.A> - TYPE_PARAMETER name:T index:0 variance:out superTypes:[kotlin.Any?] - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:Foo modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Foo - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:B modality:OPEN visibility:public superTypes:[.Foo; .A<.B>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B - CONSTRUCTOR visibility:public <> () returnType:.B [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:OPEN visibility:public superTypes:[.Foo; .A<.B>]' - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in .Foo - public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in .A - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int [fake_override] declared in .Foo - public open fun hashCode (): kotlin.Int [fake_override] declared in .A - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String [fake_override] declared in .Foo - public open fun toString (): kotlin.String [fake_override] declared in .A - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:C modality:OPEN visibility:public superTypes:[.Foo; .A<.C>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C - CONSTRUCTOR visibility:public <> () returnType:.C [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:OPEN visibility:public superTypes:[.Foo; .A<.C>]' - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in .Foo - public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in .A - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int [fake_override] declared in .Foo - public open fun hashCode (): kotlin.Int [fake_override] declared in .A - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String [fake_override] declared in .Foo - public open fun toString (): kotlin.String [fake_override] declared in .A - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:run visibility:public modality:FINAL (fn:kotlin.Function0.run>) returnType:T of .run - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] - VALUE_PARAMETER name:fn index:0 type:kotlin.Function0.run> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun run (fn: kotlin.Function0.run>): T of .run declared in ' - CALL 'public abstract fun invoke (): R of kotlin.Function0 [operator] declared in kotlin.Function0' type=T of .run origin=INVOKE - $this: GET_VAR 'fn: kotlin.Function0.run> declared in .run' type=kotlin.Function0.run> origin=VARIABLE_AS_FUNCTION - FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.Any declared in ' - CALL 'public final fun run (fn: kotlin.Function0.run>): T of .run declared in ' type=.Foo origin=null - : .Foo - fn: FUN_EXPR type=kotlin.Function0 origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:.Foo - BLOCK_BODY - VAR name:mm type:.B [val] - CONSTRUCTOR_CALL 'public constructor () [primary] declared in .B' type=.B origin=null - VAR name:nn type:.C [val] - CONSTRUCTOR_CALL 'public constructor () [primary] declared in .C' type=.C origin=null - VAR name:c type:.Foo [val] - WHEN type=.Foo origin=IF - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: GET_VAR 'val mm: .B [val] declared in .foo.' type=.B origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: GET_VAR 'val nn: .C [val] declared in .foo.' type=.C origin=null - RETURN type=kotlin.Nothing from='local final fun (): .Foo declared in .foo' - GET_VAR 'val c: .Foo [val] declared in .foo.' type=.Foo origin=null diff --git a/compiler/testData/ir/irText/types/intersectionType2_OI.fir.kt.txt b/compiler/testData/ir/irText/types/intersectionType2_OI.fir.kt.txt deleted file mode 100644 index 5c3a035fec9..00000000000 --- a/compiler/testData/ir/irText/types/intersectionType2_OI.fir.kt.txt +++ /dev/null @@ -1,42 +0,0 @@ -interface A { - -} - -interface Foo { - -} - -open class B : Foo, A { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - -} - -open class C : Foo, A { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - -} - -fun run(fn: Function0): T { - return fn.invoke() -} - -fun foo(): Any { - return run(fn = local fun (): Foo { - val mm: B = B() - val nn: C = C() - val c: Foo = when { - true -> mm - else -> nn - } - return c - } -) -} diff --git a/compiler/testData/ir/irText/types/intersectionType2_OI.ir.txt b/compiler/testData/ir/irText/types/intersectionType2_OI.ir.txt deleted file mode 100644 index 2be2b32081f..00000000000 --- a/compiler/testData/ir/irText/types/intersectionType2_OI.ir.txt +++ /dev/null @@ -1,105 +0,0 @@ -FILE fqName: fileName:/intersectionType2_OI.kt - CLASS INTERFACE name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A.A> - TYPE_PARAMETER name:T index:0 variance:out superTypes:[kotlin.Any?] - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:Foo modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Foo - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:B modality:OPEN visibility:public superTypes:[.Foo; .A<.B>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B - CONSTRUCTOR visibility:public <> () returnType:.B [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:OPEN visibility:public superTypes:[.Foo; .A<.B>]' - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in .Foo - public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in .A - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int [fake_override] declared in .Foo - public open fun hashCode (): kotlin.Int [fake_override] declared in .A - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String [fake_override] declared in .Foo - public open fun toString (): kotlin.String [fake_override] declared in .A - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:C modality:OPEN visibility:public superTypes:[.Foo; .A<.C>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C - CONSTRUCTOR visibility:public <> () returnType:.C [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:OPEN visibility:public superTypes:[.Foo; .A<.C>]' - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in .Foo - public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in .A - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int [fake_override] declared in .Foo - public open fun hashCode (): kotlin.Int [fake_override] declared in .A - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String [fake_override] declared in .Foo - public open fun toString (): kotlin.String [fake_override] declared in .A - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:run visibility:public modality:FINAL (fn:kotlin.Function0.run>) returnType:T of .run - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] - VALUE_PARAMETER name:fn index:0 type:kotlin.Function0.run> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun run (fn: kotlin.Function0.run>): T of .run declared in ' - CALL 'public abstract fun invoke (): R of kotlin.Function0 [operator] declared in kotlin.Function0' type=T of .run origin=INVOKE - $this: GET_VAR 'fn: kotlin.Function0.run> declared in .run' type=kotlin.Function0.run> origin=VARIABLE_AS_FUNCTION - FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.Any declared in ' - CALL 'public final fun run (fn: kotlin.Function0.run>): T of .run declared in ' type=kotlin.Any origin=null - : kotlin.Any - fn: FUN_EXPR type=kotlin.Function0 origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Any - BLOCK_BODY - VAR name:mm type:.B [val] - CONSTRUCTOR_CALL 'public constructor () [primary] declared in .B' type=.B origin=null - VAR name:nn type:.C [val] - CONSTRUCTOR_CALL 'public constructor () [primary] declared in .C' type=.C origin=null - VAR name:c type:kotlin.Any [val] - WHEN type=kotlin.Any origin=IF - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: GET_VAR 'val mm: .B [val] declared in .foo.' type=.B origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: GET_VAR 'val nn: .C [val] declared in .foo.' type=.C origin=null - RETURN type=kotlin.Nothing from='local final fun (): kotlin.Any declared in .foo' - GET_VAR 'val c: kotlin.Any [val] declared in .foo.' type=kotlin.Any origin=null diff --git a/compiler/testData/ir/irText/types/intersectionType2_OI.kt b/compiler/testData/ir/irText/types/intersectionType2_OI.kt deleted file mode 100644 index 92dd717aa35..00000000000 --- a/compiler/testData/ir/irText/types/intersectionType2_OI.kt +++ /dev/null @@ -1,18 +0,0 @@ -// !LANGUAGE: -NewInference - -interface A -interface Foo - -open class B : Foo, A -open class C : Foo, A - -fun run(fn: () -> T) = fn() - -fun foo() = run { - val mm = B() - val nn = C() - - val c = if (true) mm else nn - - c -} \ No newline at end of file diff --git a/compiler/testData/ir/irText/types/intersectionType2_OI.kt.txt b/compiler/testData/ir/irText/types/intersectionType2_OI.kt.txt deleted file mode 100644 index a49ffc2b7a3..00000000000 --- a/compiler/testData/ir/irText/types/intersectionType2_OI.kt.txt +++ /dev/null @@ -1,42 +0,0 @@ -interface A { - -} - -interface Foo { - -} - -open class B : Foo, A { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - -} - -open class C : Foo, A { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - -} - -fun run(fn: Function0): T { - return fn.invoke() -} - -fun foo(): Any { - return run(fn = local fun (): Any { - val mm: B = B() - val nn: C = C() - val c: Any = when { - true -> mm - else -> nn - } - return c - } -) -} diff --git a/compiler/testData/ir/irText/types/intersectionType3_NI.ir.txt b/compiler/testData/ir/irText/types/intersectionType3.ir.txt similarity index 99% rename from compiler/testData/ir/irText/types/intersectionType3_NI.ir.txt rename to compiler/testData/ir/irText/types/intersectionType3.ir.txt index 1bac822f0b6..f36f6c0ef49 100644 --- a/compiler/testData/ir/irText/types/intersectionType3_NI.ir.txt +++ b/compiler/testData/ir/irText/types/intersectionType3.ir.txt @@ -1,4 +1,4 @@ -FILE fqName: fileName:/intersectionType3_NI.kt +FILE fqName: fileName:/intersectionType3.kt CLASS INTERFACE name:In modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.In.In> TYPE_PARAMETER name:T index:0 variance:in superTypes:[kotlin.Any?] diff --git a/compiler/testData/ir/irText/types/intersectionType3_NI.kt b/compiler/testData/ir/irText/types/intersectionType3.kt similarity index 95% rename from compiler/testData/ir/irText/types/intersectionType3_NI.kt rename to compiler/testData/ir/irText/types/intersectionType3.kt index e410a6aab27..18cb50f94f6 100644 --- a/compiler/testData/ir/irText/types/intersectionType3_NI.kt +++ b/compiler/testData/ir/irText/types/intersectionType3.kt @@ -1,5 +1,4 @@ // FIR_IDENTICAL -// !LANGUAGE: +NewInference interface In diff --git a/compiler/testData/ir/irText/types/intersectionType3_NI.kt.txt b/compiler/testData/ir/irText/types/intersectionType3.kt.txt similarity index 100% rename from compiler/testData/ir/irText/types/intersectionType3_NI.kt.txt rename to compiler/testData/ir/irText/types/intersectionType3.kt.txt diff --git a/compiler/testData/ir/irText/types/intersectionType3_OI.fir.ir.txt b/compiler/testData/ir/irText/types/intersectionType3_OI.fir.ir.txt deleted file mode 100644 index 361246b3813..00000000000 --- a/compiler/testData/ir/irText/types/intersectionType3_OI.fir.ir.txt +++ /dev/null @@ -1,200 +0,0 @@ -FILE fqName: fileName:/intersectionType3_OI.kt - CLASS INTERFACE name:In modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.In.In> - TYPE_PARAMETER name:T index:0 variance:in superTypes:[kotlin.Any?] - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:isT visibility:public modality:FINAL ($receiver:.In.isT>) returnType:kotlin.Boolean [inline] - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] - $receiver: VALUE_PARAMETER name: type:.In.isT> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun isT (): kotlin.Boolean [inline] declared in ' - TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=T of .isT - GET_VAR ': .In.isT> declared in .isT' type=.In.isT> origin=null - FUN name:asT visibility:public modality:FINAL ($receiver:.In.asT>) returnType:kotlin.Unit [inline] - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] - $receiver: VALUE_PARAMETER name: type:.In.asT> - BLOCK_BODY - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - TYPE_OP type=T of .asT origin=CAST typeOperand=T of .asT - GET_VAR ': .In.asT> declared in .asT' type=.In.asT> origin=null - FUN name:sel visibility:public modality:FINAL (x:S of .sel, y:S of .sel) returnType:S of .sel - TYPE_PARAMETER name:S index:0 variance: superTypes:[kotlin.Any?] - VALUE_PARAMETER name:x index:0 type:S of .sel - VALUE_PARAMETER name:y index:1 type:S of .sel - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun sel (x: S of .sel, y: S of .sel): S of .sel declared in ' - GET_VAR 'x: S of .sel declared in .sel' type=S of .sel origin=null - CLASS INTERFACE name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:B modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:A1 modality:ABSTRACT visibility:public superTypes:[.A] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A1 - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in .A - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int [fake_override] declared in .A - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String [fake_override] declared in .A - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:A2 modality:ABSTRACT visibility:public superTypes:[.A] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A2 - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in .A - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int [fake_override] declared in .A - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String [fake_override] declared in .A - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:Z1 modality:ABSTRACT visibility:public superTypes:[.A; .B] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Z1 - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in .A - public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in .B - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int [fake_override] declared in .A - public open fun hashCode (): kotlin.Int [fake_override] declared in .B - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String [fake_override] declared in .A - public open fun toString (): kotlin.String [fake_override] declared in .B - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:Z2 modality:ABSTRACT visibility:public superTypes:[.A; .B] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Z2 - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in .A - public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in .B - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int [fake_override] declared in .A - public open fun hashCode (): kotlin.Int [fake_override] declared in .B - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String [fake_override] declared in .A - public open fun toString (): kotlin.String [fake_override] declared in .B - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:testInIs1 visibility:public modality:FINAL <> (x:.In<.A>, y:.In<.B>) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:.In<.A> - VALUE_PARAMETER name:y index:1 type:.In<.B> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testInIs1 (x: .In<.A>, y: .In<.B>): kotlin.Boolean declared in ' - CALL 'public final fun isT (): kotlin.Boolean [inline] declared in ' type=kotlin.Boolean origin=null - : kotlin.Any - $receiver: CALL 'public final fun sel (x: S of .sel, y: S of .sel): S of .sel declared in ' type=.In origin=null - : .In - x: GET_VAR 'x: .In<.A> declared in .testInIs1' type=.In<.A> origin=null - y: GET_VAR 'y: .In<.B> declared in .testInIs1' type=.In<.B> origin=null - FUN name:testInIs2 visibility:public modality:FINAL <> (x:.In<.Z1>, y:.In<.Z2>) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:.In<.Z1> - VALUE_PARAMETER name:y index:1 type:.In<.Z2> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testInIs2 (x: .In<.Z1>, y: .In<.Z2>): kotlin.Boolean declared in ' - CALL 'public final fun isT (): kotlin.Boolean [inline] declared in ' type=kotlin.Boolean origin=null - : kotlin.Any - $receiver: CALL 'public final fun sel (x: S of .sel, y: S of .sel): S of .sel declared in ' type=.In origin=null - : .In - x: GET_VAR 'x: .In<.Z1> declared in .testInIs2' type=.In<.Z1> origin=null - y: GET_VAR 'y: .In<.Z2> declared in .testInIs2' type=.In<.Z2> origin=null - FUN name:testInIs3 visibility:public modality:FINAL <> (x:.In<.A1>, y:.In<.A2>) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:.In<.A1> - VALUE_PARAMETER name:y index:1 type:.In<.A2> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testInIs3 (x: .In<.A1>, y: .In<.A2>): kotlin.Boolean declared in ' - CALL 'public final fun isT (): kotlin.Boolean [inline] declared in ' type=kotlin.Boolean origin=null - : .A - $receiver: CALL 'public final fun sel (x: S of .sel, y: S of .sel): S of .sel declared in ' type=.In origin=null - : .In - x: GET_VAR 'x: .In<.A1> declared in .testInIs3' type=.In<.A1> origin=null - y: GET_VAR 'y: .In<.A2> declared in .testInIs3' type=.In<.A2> origin=null - FUN name:testInAs1 visibility:public modality:FINAL <> (x:.In<.A>, y:.In<.B>) returnType:kotlin.Unit - VALUE_PARAMETER name:x index:0 type:.In<.A> - VALUE_PARAMETER name:y index:1 type:.In<.B> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testInAs1 (x: .In<.A>, y: .In<.B>): kotlin.Unit declared in ' - CALL 'public final fun asT (): kotlin.Unit [inline] declared in ' type=kotlin.Unit origin=null - : kotlin.Any - $receiver: CALL 'public final fun sel (x: S of .sel, y: S of .sel): S of .sel declared in ' type=.In origin=null - : .In - x: GET_VAR 'x: .In<.A> declared in .testInAs1' type=.In<.A> origin=null - y: GET_VAR 'y: .In<.B> declared in .testInAs1' type=.In<.B> origin=null - FUN name:testInAs2 visibility:public modality:FINAL <> (x:.In<.Z1>, y:.In<.Z2>) returnType:kotlin.Unit - VALUE_PARAMETER name:x index:0 type:.In<.Z1> - VALUE_PARAMETER name:y index:1 type:.In<.Z2> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testInAs2 (x: .In<.Z1>, y: .In<.Z2>): kotlin.Unit declared in ' - CALL 'public final fun asT (): kotlin.Unit [inline] declared in ' type=kotlin.Unit origin=null - : kotlin.Any - $receiver: CALL 'public final fun sel (x: S of .sel, y: S of .sel): S of .sel declared in ' type=.In origin=null - : .In - x: GET_VAR 'x: .In<.Z1> declared in .testInAs2' type=.In<.Z1> origin=null - y: GET_VAR 'y: .In<.Z2> declared in .testInAs2' type=.In<.Z2> origin=null - FUN name:testInAs3 visibility:public modality:FINAL <> (x:.In<.A1>, y:.In<.A2>) returnType:kotlin.Unit - VALUE_PARAMETER name:x index:0 type:.In<.A1> - VALUE_PARAMETER name:y index:1 type:.In<.A2> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testInAs3 (x: .In<.A1>, y: .In<.A2>): kotlin.Unit declared in ' - CALL 'public final fun asT (): kotlin.Unit [inline] declared in ' type=kotlin.Unit origin=null - : .A - $receiver: CALL 'public final fun sel (x: S of .sel, y: S of .sel): S of .sel declared in ' type=.In origin=null - : .In - x: GET_VAR 'x: .In<.A1> declared in .testInAs3' type=.In<.A1> origin=null - y: GET_VAR 'y: .In<.A2> declared in .testInAs3' type=.In<.A2> origin=null diff --git a/compiler/testData/ir/irText/types/intersectionType3_OI.fir.kt.txt b/compiler/testData/ir/irText/types/intersectionType3_OI.fir.kt.txt deleted file mode 100644 index c4bfe708b73..00000000000 --- a/compiler/testData/ir/irText/types/intersectionType3_OI.fir.kt.txt +++ /dev/null @@ -1,63 +0,0 @@ -interface In { - -} - -inline fun In.isT(): Boolean { - return is T -} - -inline fun In.asT() { - as T /*~> Unit */ -} - -fun sel(x: S, y: S): S { - return x -} - -interface A { - -} - -interface B { - -} - -interface A1 : A { - -} - -interface A2 : A { - -} - -interface Z1 : A, B { - -} - -interface Z2 : A, B { - -} - -fun testInIs1(x: In, y: In): Boolean { - return sel>(x = x, y = y).isT() -} - -fun testInIs2(x: In, y: In): Boolean { - return sel>(x = x, y = y).isT() -} - -fun testInIs3(x: In, y: In): Boolean { - return sel>(x = x, y = y).isT() -} - -fun testInAs1(x: In, y: In) { - return sel>(x = x, y = y).asT() -} - -fun testInAs2(x: In, y: In) { - return sel>(x = x, y = y).asT() -} - -fun testInAs3(x: In, y: In) { - return sel>(x = x, y = y).asT() -} diff --git a/compiler/testData/ir/irText/types/intersectionType3_OI.ir.txt b/compiler/testData/ir/irText/types/intersectionType3_OI.ir.txt deleted file mode 100644 index 9b457eea524..00000000000 --- a/compiler/testData/ir/irText/types/intersectionType3_OI.ir.txt +++ /dev/null @@ -1,200 +0,0 @@ -FILE fqName: fileName:/intersectionType3_OI.kt - CLASS INTERFACE name:In modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.In.In> - TYPE_PARAMETER name:T index:0 variance:in superTypes:[kotlin.Any?] - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:isT visibility:public modality:FINAL ($receiver:.In.isT>) returnType:kotlin.Boolean [inline] - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] - $receiver: VALUE_PARAMETER name: type:.In.isT> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun isT (): kotlin.Boolean [inline] declared in ' - TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=T of .isT - GET_VAR ': .In.isT> declared in .isT' type=.In.isT> origin=null - FUN name:asT visibility:public modality:FINAL ($receiver:.In.asT>) returnType:kotlin.Unit [inline] - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] - $receiver: VALUE_PARAMETER name: type:.In.asT> - BLOCK_BODY - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - TYPE_OP type=T of .asT origin=CAST typeOperand=T of .asT - GET_VAR ': .In.asT> declared in .asT' type=.In.asT> origin=null - FUN name:sel visibility:public modality:FINAL (x:S of .sel, y:S of .sel) returnType:S of .sel - TYPE_PARAMETER name:S index:0 variance: superTypes:[kotlin.Any?] - VALUE_PARAMETER name:x index:0 type:S of .sel - VALUE_PARAMETER name:y index:1 type:S of .sel - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun sel (x: S of .sel, y: S of .sel): S of .sel declared in ' - GET_VAR 'x: S of .sel declared in .sel' type=S of .sel origin=null - CLASS INTERFACE name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:B modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:A1 modality:ABSTRACT visibility:public superTypes:[.A] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A1 - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in .A - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int [fake_override] declared in .A - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String [fake_override] declared in .A - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:A2 modality:ABSTRACT visibility:public superTypes:[.A] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A2 - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in .A - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int [fake_override] declared in .A - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String [fake_override] declared in .A - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:Z1 modality:ABSTRACT visibility:public superTypes:[.A; .B] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Z1 - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in .A - public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in .B - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int [fake_override] declared in .A - public open fun hashCode (): kotlin.Int [fake_override] declared in .B - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String [fake_override] declared in .A - public open fun toString (): kotlin.String [fake_override] declared in .B - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:Z2 modality:ABSTRACT visibility:public superTypes:[.A; .B] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Z2 - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in .A - public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in .B - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int [fake_override] declared in .A - public open fun hashCode (): kotlin.Int [fake_override] declared in .B - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String [fake_override] declared in .A - public open fun toString (): kotlin.String [fake_override] declared in .B - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:testInIs1 visibility:public modality:FINAL <> (x:.In<.A>, y:.In<.B>) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:.In<.A> - VALUE_PARAMETER name:y index:1 type:.In<.B> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testInIs1 (x: .In<.A>, y: .In<.B>): kotlin.Boolean declared in ' - CALL 'public final fun isT (): kotlin.Boolean [inline] declared in ' type=kotlin.Boolean origin=null - : kotlin.Any - $receiver: CALL 'public final fun sel (x: S of .sel, y: S of .sel): S of .sel declared in ' type=.In origin=null - : .In - x: GET_VAR 'x: .In<.A> declared in .testInIs1' type=.In<.A> origin=null - y: GET_VAR 'y: .In<.B> declared in .testInIs1' type=.In<.B> origin=null - FUN name:testInIs2 visibility:public modality:FINAL <> (x:.In<.Z1>, y:.In<.Z2>) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:.In<.Z1> - VALUE_PARAMETER name:y index:1 type:.In<.Z2> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testInIs2 (x: .In<.Z1>, y: .In<.Z2>): kotlin.Boolean declared in ' - CALL 'public final fun isT (): kotlin.Boolean [inline] declared in ' type=kotlin.Boolean origin=null - : kotlin.Any - $receiver: CALL 'public final fun sel (x: S of .sel, y: S of .sel): S of .sel declared in ' type=.In origin=null - : .In - x: GET_VAR 'x: .In<.Z1> declared in .testInIs2' type=.In<.Z1> origin=null - y: GET_VAR 'y: .In<.Z2> declared in .testInIs2' type=.In<.Z2> origin=null - FUN name:testInIs3 visibility:public modality:FINAL <> (x:.In<.A1>, y:.In<.A2>) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:.In<.A1> - VALUE_PARAMETER name:y index:1 type:.In<.A2> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testInIs3 (x: .In<.A1>, y: .In<.A2>): kotlin.Boolean declared in ' - CALL 'public final fun isT (): kotlin.Boolean [inline] declared in ' type=kotlin.Boolean origin=null - : .A - $receiver: CALL 'public final fun sel (x: S of .sel, y: S of .sel): S of .sel declared in ' type=.In<.A> origin=null - : .In<.A> - x: GET_VAR 'x: .In<.A1> declared in .testInIs3' type=.In<.A1> origin=null - y: GET_VAR 'y: .In<.A2> declared in .testInIs3' type=.In<.A2> origin=null - FUN name:testInAs1 visibility:public modality:FINAL <> (x:.In<.A>, y:.In<.B>) returnType:kotlin.Unit - VALUE_PARAMETER name:x index:0 type:.In<.A> - VALUE_PARAMETER name:y index:1 type:.In<.B> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testInAs1 (x: .In<.A>, y: .In<.B>): kotlin.Unit declared in ' - CALL 'public final fun asT (): kotlin.Unit [inline] declared in ' type=kotlin.Unit origin=null - : kotlin.Any - $receiver: CALL 'public final fun sel (x: S of .sel, y: S of .sel): S of .sel declared in ' type=.In origin=null - : .In - x: GET_VAR 'x: .In<.A> declared in .testInAs1' type=.In<.A> origin=null - y: GET_VAR 'y: .In<.B> declared in .testInAs1' type=.In<.B> origin=null - FUN name:testInAs2 visibility:public modality:FINAL <> (x:.In<.Z1>, y:.In<.Z2>) returnType:kotlin.Unit - VALUE_PARAMETER name:x index:0 type:.In<.Z1> - VALUE_PARAMETER name:y index:1 type:.In<.Z2> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testInAs2 (x: .In<.Z1>, y: .In<.Z2>): kotlin.Unit declared in ' - CALL 'public final fun asT (): kotlin.Unit [inline] declared in ' type=kotlin.Unit origin=null - : kotlin.Any - $receiver: CALL 'public final fun sel (x: S of .sel, y: S of .sel): S of .sel declared in ' type=.In origin=null - : .In - x: GET_VAR 'x: .In<.Z1> declared in .testInAs2' type=.In<.Z1> origin=null - y: GET_VAR 'y: .In<.Z2> declared in .testInAs2' type=.In<.Z2> origin=null - FUN name:testInAs3 visibility:public modality:FINAL <> (x:.In<.A1>, y:.In<.A2>) returnType:kotlin.Unit - VALUE_PARAMETER name:x index:0 type:.In<.A1> - VALUE_PARAMETER name:y index:1 type:.In<.A2> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testInAs3 (x: .In<.A1>, y: .In<.A2>): kotlin.Unit declared in ' - CALL 'public final fun asT (): kotlin.Unit [inline] declared in ' type=kotlin.Unit origin=null - : .A - $receiver: CALL 'public final fun sel (x: S of .sel, y: S of .sel): S of .sel declared in ' type=.In<.A> origin=null - : .In<.A> - x: GET_VAR 'x: .In<.A1> declared in .testInAs3' type=.In<.A1> origin=null - y: GET_VAR 'y: .In<.A2> declared in .testInAs3' type=.In<.A2> origin=null diff --git a/compiler/testData/ir/irText/types/intersectionType3_OI.kt b/compiler/testData/ir/irText/types/intersectionType3_OI.kt deleted file mode 100644 index 97edb5d35bf..00000000000 --- a/compiler/testData/ir/irText/types/intersectionType3_OI.kt +++ /dev/null @@ -1,32 +0,0 @@ -// !LANGUAGE: -NewInference - -interface In - -inline fun In.isT(): Boolean = - this is T - -inline fun In.asT() { this as T } - -fun sel(x: S, y: S): S = x - -interface A -interface B - -interface A1 : A -interface A2 : A - -interface Z1 : A, B -interface Z2 : A, B - - -fun testInIs1(x: In, y: In) = sel(x, y).isT() - -fun testInIs2(x: In, y: In) = sel(x, y).isT() - -fun testInIs3(x: In, y: In) = sel(x, y).isT() - -fun testInAs1(x: In, y: In) = sel(x, y).asT() - -fun testInAs2(x: In, y: In) = sel(x, y).asT() - -fun testInAs3(x: In, y: In) = sel(x, y).asT() diff --git a/compiler/testData/ir/irText/types/intersectionType3_OI.kt.txt b/compiler/testData/ir/irText/types/intersectionType3_OI.kt.txt deleted file mode 100644 index 34381af28cc..00000000000 --- a/compiler/testData/ir/irText/types/intersectionType3_OI.kt.txt +++ /dev/null @@ -1,63 +0,0 @@ -interface In { - -} - -inline fun In.isT(): Boolean { - return is T -} - -inline fun In.asT() { - as T /*~> Unit */ -} - -fun sel(x: S, y: S): S { - return x -} - -interface A { - -} - -interface B { - -} - -interface A1 : A { - -} - -interface A2 : A { - -} - -interface Z1 : A, B { - -} - -interface Z2 : A, B { - -} - -fun testInIs1(x: In, y: In): Boolean { - return sel>(x = x, y = y).isT() -} - -fun testInIs2(x: In, y: In): Boolean { - return sel>(x = x, y = y).isT() -} - -fun testInIs3(x: In, y: In): Boolean { - return sel>(x = x, y = y).isT() -} - -fun testInAs1(x: In, y: In) { - return sel>(x = x, y = y).asT() -} - -fun testInAs2(x: In, y: In) { - return sel>(x = x, y = y).asT() -} - -fun testInAs3(x: In, y: In) { - return sel>(x = x, y = y).asT() -} diff --git a/compiler/testData/ir/irText/types/localVariableOfIntersectionType_NI.fir.ir.txt b/compiler/testData/ir/irText/types/localVariableOfIntersectionType.fir.ir.txt similarity index 99% rename from compiler/testData/ir/irText/types/localVariableOfIntersectionType_NI.fir.ir.txt rename to compiler/testData/ir/irText/types/localVariableOfIntersectionType.fir.ir.txt index b9616c7f93b..b3c30fa5a63 100644 --- a/compiler/testData/ir/irText/types/localVariableOfIntersectionType_NI.fir.ir.txt +++ b/compiler/testData/ir/irText/types/localVariableOfIntersectionType.fir.ir.txt @@ -1,4 +1,4 @@ -FILE fqName: fileName:/localVariableOfIntersectionType_NI.kt +FILE fqName: fileName:/localVariableOfIntersectionType.kt CLASS INTERFACE name:In modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.In.In> TYPE_PARAMETER name:T index:0 variance:in superTypes:[kotlin.Any?] diff --git a/compiler/testData/ir/irText/types/localVariableOfIntersectionType_NI.fir.kt.txt b/compiler/testData/ir/irText/types/localVariableOfIntersectionType.fir.kt.txt similarity index 100% rename from compiler/testData/ir/irText/types/localVariableOfIntersectionType_NI.fir.kt.txt rename to compiler/testData/ir/irText/types/localVariableOfIntersectionType.fir.kt.txt diff --git a/compiler/testData/ir/irText/types/localVariableOfIntersectionType_NI.ir.txt b/compiler/testData/ir/irText/types/localVariableOfIntersectionType.ir.txt similarity index 99% rename from compiler/testData/ir/irText/types/localVariableOfIntersectionType_NI.ir.txt rename to compiler/testData/ir/irText/types/localVariableOfIntersectionType.ir.txt index 0764bcd22a7..7f58256dde7 100644 --- a/compiler/testData/ir/irText/types/localVariableOfIntersectionType_NI.ir.txt +++ b/compiler/testData/ir/irText/types/localVariableOfIntersectionType.ir.txt @@ -1,4 +1,4 @@ -FILE fqName: fileName:/localVariableOfIntersectionType_NI.kt +FILE fqName: fileName:/localVariableOfIntersectionType.kt CLASS INTERFACE name:In modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.In.In> TYPE_PARAMETER name:T index:0 variance:in superTypes:[kotlin.Any?] diff --git a/compiler/testData/ir/irText/types/localVariableOfIntersectionType.kt b/compiler/testData/ir/irText/types/localVariableOfIntersectionType.kt new file mode 100644 index 00000000000..74ceabd0edb --- /dev/null +++ b/compiler/testData/ir/irText/types/localVariableOfIntersectionType.kt @@ -0,0 +1,25 @@ +interface In + +interface Inv { + val t: T +} + +interface Z { + fun create(x: In, y: In): Inv +} + +interface IA { + fun foo() +} + +interface IB { + fun bar() +} + +fun test(a: In, b: In, z: Z) { + z.create(a, b).t.foo() + z.create(a, b).t.bar() + val t = z.create(a, b).t + t.foo() + t.bar() +} diff --git a/compiler/testData/ir/irText/types/localVariableOfIntersectionType_NI.kt.txt b/compiler/testData/ir/irText/types/localVariableOfIntersectionType.kt.txt similarity index 100% rename from compiler/testData/ir/irText/types/localVariableOfIntersectionType_NI.kt.txt rename to compiler/testData/ir/irText/types/localVariableOfIntersectionType.kt.txt diff --git a/compiler/testData/ir/irText/types/localVariableOfIntersectionType_NI.kt b/compiler/testData/ir/irText/types/localVariableOfIntersectionType_NI.kt deleted file mode 100644 index f5cb91539b5..00000000000 --- a/compiler/testData/ir/irText/types/localVariableOfIntersectionType_NI.kt +++ /dev/null @@ -1,34 +0,0 @@ -// !LANGUAGE: +NewInference -// With -NewInference we have -// TYPE_INFERENCE_CONFLICTING_SUBSTITUTIONS: Type inference failed: Cannot infer type parameter T in fun create(x: In, y: In): Inv -// None of the following substitutions -// (In,In) -// (In,In) -// can be applied to -// (In,In) - -interface In - -interface Inv { - val t: T -} - -interface Z { - fun create(x: In, y: In): Inv -} - -interface IA { - fun foo() -} - -interface IB { - fun bar() -} - -fun test(a: In, b: In, z: Z) { - z.create(a, b).t.foo() - z.create(a, b).t.bar() - val t = z.create(a, b).t - t.foo() - t.bar() -} diff --git a/compiler/testData/ir/irText/types/receiverOfIntersectionType.kt b/compiler/testData/ir/irText/types/receiverOfIntersectionType.kt index 9acc5935cb5..a55478a53a4 100644 --- a/compiler/testData/ir/irText/types/receiverOfIntersectionType.kt +++ b/compiler/testData/ir/irText/types/receiverOfIntersectionType.kt @@ -1,4 +1,3 @@ -// !LANGUAGE: +NewInference // TARGET_BACKEND: JVM // FILE: receiverOfIntersectionType.kt @@ -38,4 +37,4 @@ public class Java { public static A a() { return new A(); } public static B b() { return new B(); } public static T id(T x) { return x; } -} \ No newline at end of file +} diff --git a/compiler/testData/ir/irText/types/starProjection_OI.ir.txt b/compiler/testData/ir/irText/types/starProjection.ir.txt similarity index 98% rename from compiler/testData/ir/irText/types/starProjection_OI.ir.txt rename to compiler/testData/ir/irText/types/starProjection.ir.txt index 14bf75ebab5..40b636e2b0e 100644 --- a/compiler/testData/ir/irText/types/starProjection_OI.ir.txt +++ b/compiler/testData/ir/irText/types/starProjection.ir.txt @@ -1,4 +1,4 @@ -FILE fqName: fileName:/starProjection_OI.kt +FILE fqName: fileName:/starProjection.kt CLASS INTERFACE name:Continuation modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Continuation.Continuation> TYPE_PARAMETER name:T index:0 variance:in superTypes:[kotlin.Any?] diff --git a/compiler/testData/ir/irText/types/starProjection_OI.kt b/compiler/testData/ir/irText/types/starProjection.kt similarity index 85% rename from compiler/testData/ir/irText/types/starProjection_OI.kt rename to compiler/testData/ir/irText/types/starProjection.kt index e4da55fba7a..36a984cc4af 100644 --- a/compiler/testData/ir/irText/types/starProjection_OI.kt +++ b/compiler/testData/ir/irText/types/starProjection.kt @@ -1,8 +1,7 @@ -// !LANGUAGE: -NewInference // FIR_IDENTICAL interface Continuation abstract class C { abstract fun dispatchResumeWithException(exception: Throwable, continuation: Continuation<*>): Boolean -} \ No newline at end of file +} diff --git a/compiler/testData/ir/irText/types/starProjection_OI.kt.txt b/compiler/testData/ir/irText/types/starProjection.kt.txt similarity index 100% rename from compiler/testData/ir/irText/types/starProjection_OI.kt.txt rename to compiler/testData/ir/irText/types/starProjection.kt.txt diff --git a/compiler/testData/ir/irText/types/typeAliasWithUnsafeVariance.kt b/compiler/testData/ir/irText/types/typeAliasWithUnsafeVariance.kt index 5261aab0215..bd2aff5ff6d 100644 --- a/compiler/testData/ir/irText/types/typeAliasWithUnsafeVariance.kt +++ b/compiler/testData/ir/irText/types/typeAliasWithUnsafeVariance.kt @@ -1,14 +1,10 @@ -// !LANGUAGE: +NewInference - // KT-42036 typealias Action = (@UnsafeVariance RenderingT) -> Unit -// When a typealias is used, the compiler crashes. + data class Tag(val action: Action) -// When no typealias is used, the compiler is fine. -//data class Tag(val action: (@UnsafeVariance RenderingT) -> Unit) + fun getTag(): Tag<*> = throw Exception() fun doAction() { - // This line crashes the compiler. getTag().action -} \ No newline at end of file +} diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java index b3cb7c67710..c1a8b5e0362 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java @@ -17087,12 +17087,6 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/functions/functionExpression/functionExpressionWithThisReference.kt"); } - @Test - @TestMetadata("functionExpressionWithThisReferenceNI.kt") - public void testFunctionExpressionWithThisReferenceNI() throws Exception { - runTest("compiler/testData/codegen/box/functions/functionExpression/functionExpressionWithThisReferenceNI.kt"); - } - @Test @TestMetadata("functionLiteralExpression.kt") public void testFunctionLiteralExpression() throws Exception { @@ -23420,12 +23414,6 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/javaInterop/genericSamProjectedOut.kt"); } - @Test - @TestMetadata("genericSamProjectedOutWithNewInference.kt") - public void testGenericSamProjectedOutWithNewInference() throws Exception { - runTest("compiler/testData/codegen/box/javaInterop/genericSamProjectedOutWithNewInference.kt"); - } - @Test @TestMetadata("genericSamSmartcast.kt") public void testGenericSamSmartcast() throws Exception { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java index cec7d71ab2d..b044b08f6ea 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java @@ -17231,12 +17231,6 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/functions/functionExpression/functionExpressionWithThisReference.kt"); } - @Test - @TestMetadata("functionExpressionWithThisReferenceNI.kt") - public void testFunctionExpressionWithThisReferenceNI() throws Exception { - runTest("compiler/testData/codegen/box/functions/functionExpression/functionExpressionWithThisReferenceNI.kt"); - } - @Test @TestMetadata("functionLiteralExpression.kt") public void testFunctionLiteralExpression() throws Exception { @@ -23582,12 +23576,6 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/javaInterop/genericSamProjectedOut.kt"); } - @Test - @TestMetadata("genericSamProjectedOutWithNewInference.kt") - public void testGenericSamProjectedOutWithNewInference() throws Exception { - runTest("compiler/testData/codegen/box/javaInterop/genericSamProjectedOutWithNewInference.kt"); - } - @Test @TestMetadata("genericSamSmartcast.kt") public void testGenericSamSmartcast() throws Exception { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/IrTextTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/IrTextTestGenerated.java index 89c06b8801d..a460762fc83 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/IrTextTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/IrTextTestGenerated.java @@ -2177,12 +2177,6 @@ public class IrTextTestGenerated extends AbstractIrTextTest { runTest("compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.kt"); } - @Test - @TestMetadata("samConversionInGenericConstructorCall_NI.kt") - public void testSamConversionInGenericConstructorCall_NI() throws Exception { - runTest("compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall_NI.kt"); - } - @Test @TestMetadata("samConversionToGeneric.kt") public void testSamConversionToGeneric() throws Exception { @@ -2544,6 +2538,12 @@ public class IrTextTestGenerated extends AbstractIrTextTest { runTest("compiler/testData/ir/irText/regressions/kt45236.kt"); } + @Test + @TestMetadata("newInferenceFixationOrder1.kt") + public void testNewInferenceFixationOrder1() throws Exception { + runTest("compiler/testData/ir/irText/regressions/newInferenceFixationOrder1.kt"); + } + @Test @TestMetadata("typeAliasCtorForGenericClass.kt") public void testTypeAliasCtorForGenericClass() throws Exception { @@ -2555,22 +2555,6 @@ public class IrTextTestGenerated extends AbstractIrTextTest { public void testTypeParametersInImplicitCast() throws Exception { runTest("compiler/testData/ir/irText/regressions/typeParametersInImplicitCast.kt"); } - - @Nested - @TestMetadata("compiler/testData/ir/irText/regressions/newInference") - @TestDataPath("$PROJECT_ROOT") - public class NewInference { - @Test - public void testAllFilesPresentInNewInference() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/ir/irText/regressions/newInference"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); - } - - @Test - @TestMetadata("fixationOrder1.kt") - public void testFixationOrder1() throws Exception { - runTest("compiler/testData/ir/irText/regressions/newInference/fixationOrder1.kt"); - } - } } @Nested @@ -2789,39 +2773,21 @@ public class IrTextTestGenerated extends AbstractIrTextTest { } @Test - @TestMetadata("intersectionType1_NI.kt") - public void testIntersectionType1_NI() throws Exception { - runTest("compiler/testData/ir/irText/types/intersectionType1_NI.kt"); + @TestMetadata("intersectionType1.kt") + public void testIntersectionType1() throws Exception { + runTest("compiler/testData/ir/irText/types/intersectionType1.kt"); } @Test - @TestMetadata("intersectionType1_OI.kt") - public void testIntersectionType1_OI() throws Exception { - runTest("compiler/testData/ir/irText/types/intersectionType1_OI.kt"); + @TestMetadata("intersectionType2.kt") + public void testIntersectionType2() throws Exception { + runTest("compiler/testData/ir/irText/types/intersectionType2.kt"); } @Test - @TestMetadata("intersectionType2_NI.kt") - public void testIntersectionType2_NI() throws Exception { - runTest("compiler/testData/ir/irText/types/intersectionType2_NI.kt"); - } - - @Test - @TestMetadata("intersectionType2_OI.kt") - public void testIntersectionType2_OI() throws Exception { - runTest("compiler/testData/ir/irText/types/intersectionType2_OI.kt"); - } - - @Test - @TestMetadata("intersectionType3_NI.kt") - public void testIntersectionType3_NI() throws Exception { - runTest("compiler/testData/ir/irText/types/intersectionType3_NI.kt"); - } - - @Test - @TestMetadata("intersectionType3_OI.kt") - public void testIntersectionType3_OI() throws Exception { - runTest("compiler/testData/ir/irText/types/intersectionType3_OI.kt"); + @TestMetadata("intersectionType3.kt") + public void testIntersectionType3() throws Exception { + runTest("compiler/testData/ir/irText/types/intersectionType3.kt"); } @Test @@ -2843,9 +2809,9 @@ public class IrTextTestGenerated extends AbstractIrTextTest { } @Test - @TestMetadata("localVariableOfIntersectionType_NI.kt") - public void testLocalVariableOfIntersectionType_NI() throws Exception { - runTest("compiler/testData/ir/irText/types/localVariableOfIntersectionType_NI.kt"); + @TestMetadata("localVariableOfIntersectionType.kt") + public void testLocalVariableOfIntersectionType() throws Exception { + runTest("compiler/testData/ir/irText/types/localVariableOfIntersectionType.kt"); } @Test @@ -2879,9 +2845,9 @@ public class IrTextTestGenerated extends AbstractIrTextTest { } @Test - @TestMetadata("starProjection_OI.kt") - public void testStarProjection_OI() throws Exception { - runTest("compiler/testData/ir/irText/types/starProjection_OI.kt"); + @TestMetadata("starProjection.kt") + public void testStarProjection() throws Exception { + runTest("compiler/testData/ir/irText/types/starProjection.kt"); } @Test diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index 73cd60bc688..afbbd4d07ca 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -14130,11 +14130,6 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/functions/functionExpression/functionExpressionWithThisReference.kt"); } - @TestMetadata("functionExpressionWithThisReferenceNI.kt") - public void testFunctionExpressionWithThisReferenceNI() throws Exception { - runTest("compiler/testData/codegen/box/functions/functionExpression/functionExpressionWithThisReferenceNI.kt"); - } - @TestMetadata("functionLiteralExpression.kt") public void testFunctionLiteralExpression() throws Exception { runTest("compiler/testData/codegen/box/functions/functionExpression/functionLiteralExpression.kt"); @@ -19655,11 +19650,6 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/javaInterop/genericSamProjectedOut.kt"); } - @TestMetadata("genericSamProjectedOutWithNewInference.kt") - public void testGenericSamProjectedOutWithNewInference() throws Exception { - runTest("compiler/testData/codegen/box/javaInterop/genericSamProjectedOutWithNewInference.kt"); - } - @TestMetadata("genericSamSmartcast.kt") public void testGenericSamSmartcast() throws Exception { runTest("compiler/testData/codegen/box/javaInterop/genericSamSmartcast.kt"); diff --git a/compiler/tests-gen/org/jetbrains/kotlin/ir/KlibTextTestCaseGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/ir/KlibTextTestCaseGenerated.java index 6900c5767ad..8593f8983b9 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/ir/KlibTextTestCaseGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/ir/KlibTextTestCaseGenerated.java @@ -1894,28 +1894,15 @@ public class KlibTextTestCaseGenerated extends AbstractKlibTextTestCase { runTest("compiler/testData/ir/irText/regressions/kt45236.kt"); } + @TestMetadata("newInferenceFixationOrder1.kt") + public void testNewInferenceFixationOrder1() throws Exception { + runTest("compiler/testData/ir/irText/regressions/newInferenceFixationOrder1.kt"); + } + @TestMetadata("typeAliasCtorForGenericClass.kt") public void testTypeAliasCtorForGenericClass() throws Exception { runTest("compiler/testData/ir/irText/regressions/typeAliasCtorForGenericClass.kt"); } - - @TestMetadata("compiler/testData/ir/irText/regressions/newInference") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class NewInference extends AbstractKlibTextTestCase { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JS_IR, testDataFilePath); - } - - public void testAllFilesPresentInNewInference() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/ir/irText/regressions/newInference"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true); - } - - @TestMetadata("fixationOrder1.kt") - public void testFixationOrder1() throws Exception { - runTest("compiler/testData/ir/irText/regressions/newInference/fixationOrder1.kt"); - } - } } @TestMetadata("compiler/testData/ir/irText/singletons") @@ -2061,34 +2048,19 @@ public class KlibTextTestCaseGenerated extends AbstractKlibTextTestCase { runTest("compiler/testData/ir/irText/types/inStarProjectionInReceiverType.kt"); } - @TestMetadata("intersectionType1_NI.kt") - public void testIntersectionType1_NI() throws Exception { - runTest("compiler/testData/ir/irText/types/intersectionType1_NI.kt"); + @TestMetadata("intersectionType1.kt") + public void testIntersectionType1() throws Exception { + runTest("compiler/testData/ir/irText/types/intersectionType1.kt"); } - @TestMetadata("intersectionType1_OI.kt") - public void testIntersectionType1_OI() throws Exception { - runTest("compiler/testData/ir/irText/types/intersectionType1_OI.kt"); + @TestMetadata("intersectionType2.kt") + public void testIntersectionType2() throws Exception { + runTest("compiler/testData/ir/irText/types/intersectionType2.kt"); } - @TestMetadata("intersectionType2_NI.kt") - public void testIntersectionType2_NI() throws Exception { - runTest("compiler/testData/ir/irText/types/intersectionType2_NI.kt"); - } - - @TestMetadata("intersectionType2_OI.kt") - public void testIntersectionType2_OI() throws Exception { - runTest("compiler/testData/ir/irText/types/intersectionType2_OI.kt"); - } - - @TestMetadata("intersectionType3_NI.kt") - public void testIntersectionType3_NI() throws Exception { - runTest("compiler/testData/ir/irText/types/intersectionType3_NI.kt"); - } - - @TestMetadata("intersectionType3_OI.kt") - public void testIntersectionType3_OI() throws Exception { - runTest("compiler/testData/ir/irText/types/intersectionType3_OI.kt"); + @TestMetadata("intersectionType3.kt") + public void testIntersectionType3() throws Exception { + runTest("compiler/testData/ir/irText/types/intersectionType3.kt"); } @TestMetadata("intersectionTypeInSamType.kt") @@ -2101,9 +2073,9 @@ public class KlibTextTestCaseGenerated extends AbstractKlibTextTestCase { runTest("compiler/testData/ir/irText/types/kt36143.kt"); } - @TestMetadata("localVariableOfIntersectionType_NI.kt") - public void testLocalVariableOfIntersectionType_NI() throws Exception { - runTest("compiler/testData/ir/irText/types/localVariableOfIntersectionType_NI.kt"); + @TestMetadata("localVariableOfIntersectionType.kt") + public void testLocalVariableOfIntersectionType() throws Exception { + runTest("compiler/testData/ir/irText/types/localVariableOfIntersectionType.kt"); } @TestMetadata("smartCastOnFakeOverrideReceiver.kt") @@ -2116,9 +2088,9 @@ public class KlibTextTestCaseGenerated extends AbstractKlibTextTestCase { runTest("compiler/testData/ir/irText/types/smartCastOnReceiverOfGenericType.kt"); } - @TestMetadata("starProjection_OI.kt") - public void testStarProjection_OI() throws Exception { - runTest("compiler/testData/ir/irText/types/starProjection_OI.kt"); + @TestMetadata("starProjection.kt") + public void testStarProjection() throws Exception { + runTest("compiler/testData/ir/irText/types/starProjection.kt"); } @TestMetadata("typeAliasWithUnsafeVariance.kt") diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java index 8deb2a0ba78..4149a9f2277 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java @@ -12434,11 +12434,6 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes runTest("compiler/testData/codegen/box/functions/functionExpression/functionExpressionWithThisReference.kt"); } - @TestMetadata("functionExpressionWithThisReferenceNI.kt") - public void testFunctionExpressionWithThisReferenceNI() throws Exception { - runTest("compiler/testData/codegen/box/functions/functionExpression/functionExpressionWithThisReferenceNI.kt"); - } - @TestMetadata("functionLiteralExpression.kt") public void testFunctionLiteralExpression() throws Exception { runTest("compiler/testData/codegen/box/functions/functionExpression/functionLiteralExpression.kt"); diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java index 098065770cd..8c4662edf1b 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java @@ -11101,11 +11101,6 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest runTest("compiler/testData/codegen/box/functions/functionExpression/functionExpressionWithThisReference.kt"); } - @TestMetadata("functionExpressionWithThisReferenceNI.kt") - public void testFunctionExpressionWithThisReferenceNI() throws Exception { - runTest("compiler/testData/codegen/box/functions/functionExpression/functionExpressionWithThisReferenceNI.kt"); - } - @TestMetadata("functionLiteralExpression.kt") public void testFunctionLiteralExpression() throws Exception { runTest("compiler/testData/codegen/box/functions/functionExpression/functionLiteralExpression.kt"); diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/testNew/IrJsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/testNew/IrJsCodegenBoxTestGenerated.java index 46ec9e63e76..17947ac6f41 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/testNew/IrJsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/testNew/IrJsCodegenBoxTestGenerated.java @@ -13363,12 +13363,6 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTest("compiler/testData/codegen/box/functions/functionExpression/functionExpressionWithThisReference.kt"); } - @Test - @TestMetadata("functionExpressionWithThisReferenceNI.kt") - public void testFunctionExpressionWithThisReferenceNI() throws Exception { - runTest("compiler/testData/codegen/box/functions/functionExpression/functionExpressionWithThisReferenceNI.kt"); - } - @Test @TestMetadata("functionLiteralExpression.kt") public void testFunctionLiteralExpression() throws Exception { diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/testNew/JsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/testNew/JsCodegenBoxTestGenerated.java index dcaf0373d49..1299b1b4520 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/testNew/JsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/testNew/JsCodegenBoxTestGenerated.java @@ -13321,12 +13321,6 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { runTest("compiler/testData/codegen/box/functions/functionExpression/functionExpressionWithThisReference.kt"); } - @Test - @TestMetadata("functionExpressionWithThisReferenceNI.kt") - public void testFunctionExpressionWithThisReferenceNI() throws Exception { - runTest("compiler/testData/codegen/box/functions/functionExpression/functionExpressionWithThisReferenceNI.kt"); - } - @Test @TestMetadata("functionLiteralExpression.kt") public void testFunctionLiteralExpression() throws Exception {