diff --git a/compiler/fir/resolve/testData/resolve/expresssions/errCallable.kt b/compiler/fir/resolve/testData/resolve/expresssions/errCallable.kt new file mode 100644 index 00000000000..9dcb5c85aba --- /dev/null +++ b/compiler/fir/resolve/testData/resolve/expresssions/errCallable.kt @@ -0,0 +1,13 @@ +class Your { + class Nested +} + +class My { + fun foo() { + val x = ::Nested // Should be error + } +} + +fun Your.foo() { + val x = ::Nested // Still should be error +} \ No newline at end of file diff --git a/compiler/fir/resolve/testData/resolve/expresssions/errCallable.txt b/compiler/fir/resolve/testData/resolve/expresssions/errCallable.txt new file mode 100644 index 00000000000..b8ae98e1c27 --- /dev/null +++ b/compiler/fir/resolve/testData/resolve/expresssions/errCallable.txt @@ -0,0 +1,27 @@ +FILE: errCallable.kt + public final class Your : R|kotlin/Any| { + public constructor(): R|Your| { + super() + } + + public final class Nested : R|kotlin/Any| { + public constructor(): R|Your.Nested| { + super() + } + + } + + } + public final class My : R|kotlin/Any| { + public constructor(): R|My| { + super() + } + + public final fun foo(): R|kotlin/Unit| { + lval x: = ::Nested# + } + + } + public final fun R|Your|.foo(): R|kotlin/Unit| { + lval x: = ::Nested# + } 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 bd9cc52d3a3..f6d5da92ed4 100644 --- a/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirDiagnosticsTestGenerated.java +++ b/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirDiagnosticsTestGenerated.java @@ -459,6 +459,11 @@ public class FirDiagnosticsTestGenerated extends AbstractFirDiagnosticsTest { runTest("compiler/fir/resolve/testData/resolve/expresssions/enumValues.kt"); } + @TestMetadata("errCallable.kt") + public void testErrCallable() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/expresssions/errCallable.kt"); + } + @TestMetadata("extensionPropertyInLambda.kt") public void testExtensionPropertyInLambda() throws Exception { runTest("compiler/fir/resolve/testData/resolve/expresssions/extensionPropertyInLambda.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 f2dcd9bebf8..fb9528f0a63 100644 --- a/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirDiagnosticsWithLightTreeTestGenerated.java +++ b/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirDiagnosticsWithLightTreeTestGenerated.java @@ -459,6 +459,11 @@ public class FirDiagnosticsWithLightTreeTestGenerated extends AbstractFirDiagnos runTest("compiler/fir/resolve/testData/resolve/expresssions/enumValues.kt"); } + @TestMetadata("errCallable.kt") + public void testErrCallable() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/expresssions/errCallable.kt"); + } + @TestMetadata("extensionPropertyInLambda.kt") public void testExtensionPropertyInLambda() throws Exception { runTest("compiler/fir/resolve/testData/resolve/expresssions/extensionPropertyInLambda.kt");