Allow to turn the first parameter of a SAM-converted lambda into the receiver (KT-12848)
This commit is contained in:
Vendored
+20
@@ -0,0 +1,20 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER,-UNUSED_VARIABLE
|
||||
|
||||
// FILE: Sam.java
|
||||
public interface Sam {
|
||||
String run(String a, String b);
|
||||
}
|
||||
|
||||
// FILE: test.kt
|
||||
fun test() {
|
||||
Sam { a, b ->
|
||||
System.out.println(a)
|
||||
""
|
||||
}
|
||||
|
||||
Sam { <!EXPECTED_PARAMETERS_NUMBER_MISMATCH!>b<!> ->
|
||||
val a = <!NO_THIS!>this@Sam<!>
|
||||
System.out.println(<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>a<!>)
|
||||
""
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user