Files
kotlin-fork/compiler/testData/diagnostics/tests/generics/varProjection/setterProjectedOutAssign.kt
T
Denis Zharkov 9773e98d8a Refine type from property setter parameter on assignment
In most cases these types are equals, the only known exception is
var-property contained in projected type member scope (see test data)
2015-12-28 11:13:37 +03:00

13 lines
279 B
Kotlin
Vendored

// !DIAGNOSTICS: -UNREACHABLE_CODE -UNUSED_PARAMETER
// !CHECK_TYPE
// t is unused due to KT-4233
interface Tr<T> {
var v: T
}
fun test(t: Tr<*>) {
t.v = null!!
t.v = <!TYPE_MISMATCH!>""<!>
t.v = <!NULL_FOR_NONNULL_TYPE!>null<!>
t.v checkType { _<Any?>() }
}