[FIR-TEST] Add test with callable reference on function with default argument
This commit is contained in:
+9
@@ -0,0 +1,9 @@
|
||||
class A {
|
||||
fun foo(s: String, flag: Boolean = true) {}
|
||||
}
|
||||
|
||||
inline fun <T> T.myLet(block: (T) -> Unit) {}
|
||||
|
||||
fun test(a: A, s: String) {
|
||||
s.<!INAPPLICABLE_CANDIDATE!>myLet<!>(a::foo)
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
FILE: callableReferencesAndDefaultParameters.kt
|
||||
public final class A : R|kotlin/Any| {
|
||||
public constructor(): R|A| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final fun foo(s: R|kotlin/String|, flag: R|kotlin/Boolean| = Boolean(true)): R|kotlin/Unit| {
|
||||
}
|
||||
|
||||
}
|
||||
public final inline fun <T> R|T|.myLet(block: R|(T) -> kotlin/Unit|): R|kotlin/Unit| {
|
||||
}
|
||||
public final fun test(a: R|A|, s: R|kotlin/String|): R|kotlin/Unit| {
|
||||
R|<local>/s|.<Inapplicable(INAPPLICABLE): [/myLet]>#(R|<local>/a|::R|/A.foo|)
|
||||
}
|
||||
+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);
|
||||
}
|
||||
|
||||
@TestMetadata("callableReferencesAndDefaultParameters.kt")
|
||||
public void testCallableReferencesAndDefaultParameters() throws Exception {
|
||||
runTest("compiler/fir/resolve/testData/resolve/problems/callableReferencesAndDefaultParameters.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("covariantArrayAsReceiver.kt")
|
||||
public void testCovariantArrayAsReceiver() throws Exception {
|
||||
runTest("compiler/fir/resolve/testData/resolve/problems/covariantArrayAsReceiver.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);
|
||||
}
|
||||
|
||||
@TestMetadata("callableReferencesAndDefaultParameters.kt")
|
||||
public void testCallableReferencesAndDefaultParameters() throws Exception {
|
||||
runTest("compiler/fir/resolve/testData/resolve/problems/callableReferencesAndDefaultParameters.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("covariantArrayAsReceiver.kt")
|
||||
public void testCovariantArrayAsReceiver() throws Exception {
|
||||
runTest("compiler/fir/resolve/testData/resolve/problems/covariantArrayAsReceiver.kt");
|
||||
|
||||
Reference in New Issue
Block a user