Files
kotlin-fork/compiler/testData/diagnostics/tests/annotations/kt1860-positive.kt
T
Mikhail Zarechenskiy bcc8802014 [NI] Avoid constraints from expected type for effectively empty system
Expression will be checked against expected type later.

 Theoretically, this is not very good, but it aligns with the old
 inference, plus it helps avoiding multiple type mismatch diagnostics.
2019-04-17 12:55:12 +03:00

15 lines
476 B
Kotlin
Vendored

// !WITH_NEW_INFERENCE
@Target(AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.EXPRESSION)
@Retention(AnnotationRetention.SOURCE)
annotation class test
fun foo(@test <!UNUSED_PARAMETER!>f<!> : Int) {}
var bar : Int = 1
set(@test <!UNUSED_PARAMETER!>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) {
}