Files
kotlin-fork/compiler/testData/diagnostics/tests/generics/varProjection/setterProjectedOutNoPlusAssign.kt
T
Mikhail Zarechenskiy 787a8bb9bd Revert "[NI] Disable capturing/approximation type in TypeSubstitutor with enabled NI"
This reverts commit 7c4101e21c.

 #KT-31866 Fixed
 #KT-31868 Fixed
 #EA-125401 Fixed
 #KT-25290 Open
2019-06-07 12:31:38 +03:00

11 lines
312 B
Kotlin
Vendored

// !DIAGNOSTICS: -UNREACHABLE_CODE
// !WITH_NEW_INFERENCE
interface Tr<T> {
var v: T
}
fun test(t: Tr<out String>) {
// resolved as t.v = t.v + null!!, where type of right operand is String,
// so TYPE_MISMATCH: String is not <: of Captured(out String)
<!SETTER_PROJECTED_OUT!>t.v<!> += null!!
}