mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-17 08:31:29 +00:00
28 lines
439 B
Kotlin
Vendored
28 lines
439 B
Kotlin
Vendored
// !DIAGNOSTICS: -UNUSED_PARAMETER,-UNUSED_VARIABLE
|
|
|
|
// FILE: Sam.java
|
|
@SamWithReceiver
|
|
public interface Sam {
|
|
void run();
|
|
}
|
|
|
|
// FILE: Exec.java
|
|
public class Exec {
|
|
void exec(Sam sam) {}
|
|
}
|
|
|
|
// FILE: test.kt
|
|
annotation class SamWithReceiver
|
|
|
|
fun test() {
|
|
val e = Exec()
|
|
|
|
e.exec {
|
|
System.out.println("Hello, world!")
|
|
}
|
|
|
|
e.exec {
|
|
val a: String = <!NO_THIS!>this<!>
|
|
System.out.println(a)
|
|
}
|
|
} |