Implement SamWithReceiverAnnotations annotation and it's handling (KT-15848)

TODO: tests
This commit is contained in:
Ilya Chernikov
2017-01-24 18:45:04 +01:00
parent f1c4230a68
commit 4bb5e978a7
7 changed files with 159 additions and 3 deletions
@@ -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) }
@@ -0,0 +1,34 @@
package
@SamWithReceiver1 public /*synthesized*/ fun Sam(/*0*/ function: (a: kotlin.String!) -> kotlin.Unit): Sam
public open class Exec {
public constructor Exec()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public/*package*/ open fun exec(/*0*/ sam: Sam!): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
@SamWithReceiver1 public interface Sam {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public abstract fun run(/*0*/ a: kotlin.String!): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
@kotlin.annotation.Retention(value = AnnotationRetention.RUNTIME) public final annotation class SamWithReceiver1 : kotlin.Annotation {
public constructor SamWithReceiver1()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public final class Test : kotlin.script.templates.standard.ScriptTemplateWithArgs {
public constructor Test(/*0*/ args: kotlin.Array<kotlin.String>)
public final override /*1*/ /*fake_override*/ val args: kotlin.Array<kotlin.String>
public final val e: Exec
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}