Implement tests to sam-with-receiver support in new scripting API

plus minor tests refactoring
This commit is contained in:
Ilya Chernikov
2019-10-14 15:07:13 +02:00
parent cf3bf5a9b9
commit 08b77bc916
8 changed files with 97 additions and 19 deletions
@@ -0,0 +1,3 @@
public class Exec {
void exec(Sam sam) {}
}
@@ -0,0 +1,4 @@
@SamWithReceiver1
public interface Sam {
void run(String a);
}
@@ -0,0 +1,6 @@
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@Retention(RetentionPolicy.RUNTIME)
public @interface SamWithReceiver1 {
}
@@ -0,0 +1,5 @@
val e = Exec()
e.exec {
this.substring(1)
}