diff --git a/compiler/fir/resolve/testData/resolve/expresssions/topExtensionVsOuterMember.kt b/compiler/fir/resolve/testData/resolve/expresssions/topExtensionVsOuterMember.kt new file mode 100644 index 00000000000..6daf0e510c1 --- /dev/null +++ b/compiler/fir/resolve/testData/resolve/expresssions/topExtensionVsOuterMember.kt @@ -0,0 +1,10 @@ +fun Outer.Inner.foo() = 42 + +class Outer { + + fun foo() = "" + + inner class Inner { + val x = foo() // Should be Int + } +} \ No newline at end of file diff --git a/compiler/fir/resolve/testData/resolve/expresssions/topExtensionVsOuterMember.txt b/compiler/fir/resolve/testData/resolve/expresssions/topExtensionVsOuterMember.txt new file mode 100644 index 00000000000..fb71c2bf620 --- /dev/null +++ b/compiler/fir/resolve/testData/resolve/expresssions/topExtensionVsOuterMember.txt @@ -0,0 +1,24 @@ +FILE: topExtensionVsOuterMember.kt + public final fun R|Outer.Inner|.foo(): R|kotlin/Int| { + ^foo Int(42) + } + public final class Outer : R|kotlin/Any| { + public constructor(): R|Outer| { + super() + } + + public final fun foo(): R|kotlin/String| { + ^foo String() + } + + public final inner class Inner : R|kotlin/Any| { + public constructor(): R|Outer.Inner| { + super() + } + + public final val x: R|kotlin/Int| = this@R|/Outer.Inner|.R|/foo|() + public get(): R|kotlin/Int| + + } + + } diff --git a/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirDiagnosticsTestGenerated.java b/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirDiagnosticsTestGenerated.java index 2662c32bc28..52d8330971e 100644 --- a/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirDiagnosticsTestGenerated.java +++ b/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirDiagnosticsTestGenerated.java @@ -684,6 +684,11 @@ public class FirDiagnosticsTestGenerated extends AbstractFirDiagnosticsTest { runTest("compiler/fir/resolve/testData/resolve/expresssions/this.kt"); } + @TestMetadata("topExtensionVsOuterMember.kt") + public void testTopExtensionVsOuterMember() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/expresssions/topExtensionVsOuterMember.kt"); + } + @TestMetadata("typeAliasConstructor.kt") public void testTypeAliasConstructor() throws Exception { runTest("compiler/fir/resolve/testData/resolve/expresssions/typeAliasConstructor.kt"); diff --git a/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirDiagnosticsWithLightTreeTestGenerated.java b/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirDiagnosticsWithLightTreeTestGenerated.java index 44b5aac812c..a21aa7594b7 100644 --- a/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirDiagnosticsWithLightTreeTestGenerated.java +++ b/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirDiagnosticsWithLightTreeTestGenerated.java @@ -684,6 +684,11 @@ public class FirDiagnosticsWithLightTreeTestGenerated extends AbstractFirDiagnos runTest("compiler/fir/resolve/testData/resolve/expresssions/this.kt"); } + @TestMetadata("topExtensionVsOuterMember.kt") + public void testTopExtensionVsOuterMember() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/expresssions/topExtensionVsOuterMember.kt"); + } + @TestMetadata("typeAliasConstructor.kt") public void testTypeAliasConstructor() throws Exception { runTest("compiler/fir/resolve/testData/resolve/expresssions/typeAliasConstructor.kt");