[FIR TEST] Add test for erroneous callable reference resolve

This commit is contained in:
Mikhail Glukhikh
2020-01-21 16:36:23 +03:00
parent c1207dd5af
commit 97d8f3fa4b
4 changed files with 50 additions and 0 deletions
@@ -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
}
@@ -0,0 +1,27 @@
FILE: errCallable.kt
public final class Your : R|kotlin/Any| {
public constructor(): R|Your| {
super<R|kotlin/Any|>()
}
public final class Nested : R|kotlin/Any| {
public constructor(): R|Your.Nested| {
super<R|kotlin/Any|>()
}
}
}
public final class My : R|kotlin/Any| {
public constructor(): R|My| {
super<R|kotlin/Any|>()
}
public final fun foo(): R|kotlin/Unit| {
lval x: <ERROR TYPE REF: No result type for initializer> = ::Nested#
}
}
public final fun R|Your|.foo(): R|kotlin/Unit| {
lval x: <ERROR TYPE REF: No result type for initializer> = ::Nested#
}
@@ -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");
@@ -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");