[SAM with receiver] Add implementation for K2

This commit is contained in:
Dmitriy Novozhilov
2022-06-22 15:24:15 +03:00
committed by teamcity
parent 49c836e706
commit 65ac82ee46
20 changed files with 306 additions and 39 deletions
@@ -1,6 +1,4 @@
// FIR_IDENTICAL
// FILE: Sam.java
// FILE: SamConstructor.kt
@SamWithReceiver
public interface Sam {
void run(String a);
@@ -17,6 +15,6 @@ annotation class SamWithReceiver
fun test() {
val e = Exec()
e.exec <!TYPE_MISMATCH!>{ <!CANNOT_INFER_PARAMETER_TYPE, EXPECTED_PARAMETERS_NUMBER_MISMATCH!>a<!> -> System.out.<!OVERLOAD_RESOLUTION_AMBIGUITY!>println<!>(<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>a<!>) }<!>
e.exec <!ARGUMENT_TYPE_MISMATCH!>{ <!CANNOT_INFER_PARAMETER_TYPE!>a<!> -> System.out.<!OVERLOAD_RESOLUTION_AMBIGUITY!>println<!>(a) }<!>
e.exec { System.out.println(this) }
}