Do not generate non-function/getter/setter (expression) annotations on anonymous functions

This commit is contained in:
Mikhail Glukhikh
2015-09-25 12:47:24 +03:00
parent 74ba21b40c
commit 103bb320c8
6 changed files with 98 additions and 2 deletions
@@ -0,0 +1,20 @@
@Target(AnnotationTarget.CLASS)
annotation class ClsAnn
@Target(AnnotationTarget.FUNCTION)
annotation class FunAnn
@Target(AnnotationTarget.EXPRESSION)
annotation class ExprAnn
fun bar(arg: () -> Int) = arg()
open class My
fun foo(arg: Int): My {
bar @FunAnn { arg }
bar @ExprAnn { arg }
val x = @FunAnn fun() = arg
// TODO: KT-9320: ClsAnn does not appear in bytecode
return (@ClsAnn object: My() {})
}