Implement SamWithReceiverAnnotations annotation and it's handling (KT-15848)
TODO: tests
This commit is contained in:
+25
@@ -0,0 +1,25 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER,-UNUSED_VARIABLE
|
||||
|
||||
// FILE: SamWithReceiver1.java
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface SamWithReceiver1 {
|
||||
}
|
||||
|
||||
// FILE: Sam.java
|
||||
@SamWithReceiver1
|
||||
public interface Sam {
|
||||
void run(String a);
|
||||
}
|
||||
|
||||
// FILE: Exec.java
|
||||
public class Exec {
|
||||
void exec(Sam sam) {}
|
||||
}
|
||||
|
||||
// FILE: test.kts
|
||||
val e = Exec()
|
||||
|
||||
e.exec { System.out.println(this) }
|
||||
Reference in New Issue
Block a user