[FIR-TEST] Add test with callable reference to member of local class
#KT-36758
This commit is contained in:
+7
@@ -0,0 +1,7 @@
|
|||||||
|
fun <T, R> List<T>.myMap(block: (T) -> R): List<R> = null!!
|
||||||
|
|
||||||
|
fun test_1() {
|
||||||
|
class Data(val x: Int)
|
||||||
|
val datas: List<Data> = null!!
|
||||||
|
val xs = datas.<!INAPPLICABLE_CANDIDATE!>myMap<!>(<!UNRESOLVED_REFERENCE!>Data::x<!>)
|
||||||
|
}
|
||||||
+18
@@ -0,0 +1,18 @@
|
|||||||
|
FILE: callableReferenceToLocalClass.kt
|
||||||
|
public final fun <T, R> R|kotlin/collections/List<T>|.myMap(block: R|(T) -> R|): R|kotlin/collections/List<R>| {
|
||||||
|
^myMap Null(null)!!
|
||||||
|
}
|
||||||
|
public final fun test_1(): R|kotlin/Unit| {
|
||||||
|
local final class Data : R|kotlin/Any| {
|
||||||
|
public constructor(x: R|kotlin/Int|): R|Data| {
|
||||||
|
super<R|kotlin/Any|>()
|
||||||
|
}
|
||||||
|
|
||||||
|
public final val x: R|kotlin/Int| = R|<local>/x|
|
||||||
|
public get(): R|kotlin/Int|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
lval datas: R|kotlin/collections/List<Data>| = Null(null)!!
|
||||||
|
lval xs: <ERROR TYPE REF: Inapplicable(INAPPLICABLE): [/myMap]> = R|<local>/datas|.<Inapplicable(INAPPLICABLE): [/myMap]>#(Q|Data|::<Unresolved name: x>#)
|
||||||
|
}
|
||||||
+5
@@ -1269,6 +1269,11 @@ public class FirDiagnosticsTestGenerated extends AbstractFirDiagnosticsTest {
|
|||||||
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/resolve/testData/resolve/problems"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
|
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/resolve/testData/resolve/problems"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("callableReferenceToLocalClass.kt")
|
||||||
|
public void testCallableReferenceToLocalClass() throws Exception {
|
||||||
|
runTest("compiler/fir/resolve/testData/resolve/problems/callableReferenceToLocalClass.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("callableReferencesAndDefaultParameters.kt")
|
@TestMetadata("callableReferencesAndDefaultParameters.kt")
|
||||||
public void testCallableReferencesAndDefaultParameters() throws Exception {
|
public void testCallableReferencesAndDefaultParameters() throws Exception {
|
||||||
runTest("compiler/fir/resolve/testData/resolve/problems/callableReferencesAndDefaultParameters.kt");
|
runTest("compiler/fir/resolve/testData/resolve/problems/callableReferencesAndDefaultParameters.kt");
|
||||||
|
|||||||
Generated
+5
@@ -1269,6 +1269,11 @@ public class FirDiagnosticsWithLightTreeTestGenerated extends AbstractFirDiagnos
|
|||||||
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/resolve/testData/resolve/problems"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
|
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/resolve/testData/resolve/problems"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("callableReferenceToLocalClass.kt")
|
||||||
|
public void testCallableReferenceToLocalClass() throws Exception {
|
||||||
|
runTest("compiler/fir/resolve/testData/resolve/problems/callableReferenceToLocalClass.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("callableReferencesAndDefaultParameters.kt")
|
@TestMetadata("callableReferencesAndDefaultParameters.kt")
|
||||||
public void testCallableReferencesAndDefaultParameters() throws Exception {
|
public void testCallableReferencesAndDefaultParameters() throws Exception {
|
||||||
runTest("compiler/fir/resolve/testData/resolve/problems/callableReferencesAndDefaultParameters.kt");
|
runTest("compiler/fir/resolve/testData/resolve/problems/callableReferencesAndDefaultParameters.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user