Files
kotlin-fork/compiler/testData/diagnostics/tests/annotations/kt1860-positive.kt
T
Mikhail Glukhikh fe13f39de9 Use of uninitialized variables in lambdas / object literals / local functions is forbidden now #KT-4475 Fixed
Local declarations CFA: variable initialization information before them is now taken into account
2015-11-17 18:21:09 +03:00

13 lines
391 B
Kotlin
Vendored

@Target(AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.EXPRESSION)
annotation class test
fun foo(@test <!UNUSED_PARAMETER!>f<!> : Int) {}
var bar : Int = 1
set(@test v) {}
val x : (Int) -> Int = {@test <!TYPE_MISMATCH, UNINITIALIZED_VARIABLE!>x<!> <!SYNTAX!>: Int -> x<!>} // todo fix parser annotation on lambda parameter
class Hello(@test <!UNUSED_PARAMETER!>args<!>: Any) {
}