[FIR-TEST] Add new testdata generated after changes in previous commit

This commit is contained in:
Dmitriy Novozhilov
2019-12-11 16:16:22 +03:00
parent e9c02a1cca
commit 2536fa0cd5
4578 changed files with 104067 additions and 1 deletions
@@ -0,0 +1,40 @@
// !WITH_NEW_INFERENCE
@Target(AnnotationTarget.FUNCTION)
annotation class FunAnn
@Target(AnnotationTarget.FUNCTION)
@Retention(AnnotationRetention.SOURCE)
annotation class SourceAnn
@Target(AnnotationTarget.EXPRESSION)
@Retention(AnnotationRetention.SOURCE)
annotation class ExprAnn
fun bar(arg: () -> Int) = arg()
inline fun fast(arg: () -> Int) = arg()
inline fun fast2(x: Int, arg: () -> Int) = x + arg()
@FunAnn fun gav() = 13
fun foo(arg: Int) {
// Literal is annotatable
bar @FunAnn { arg }
// Annotatable in principle but useless, fast is inline
fast @FunAnn { arg }
fast2(1, @FunAnn { arg })
// Source annotation, ok
fast @SourceAnn { arg }
fast2(1, @SourceAnn { arg })
// Expression annotation, ok
fast @ExprAnn { arg }
fast2(1, @ExprAnn { arg })
// Function expression too
val f = @FunAnn fun(): Int { return 42 }
// But here, f and gav should be annotated instead
bar(@FunAnn f)
bar(@FunAnn ::gav)
// Function expression, ok
fast(f)
}