Files
kotlin-fork/compiler/testData/diagnostics/tests/kt13401.kt
T
Dmitriy Novozhilov 21f0557502 Fix compatibility of CapturedTypeConstructor and NewCapturedTypeConstructor
Now both of those classes implements one interface with `TypeProjection`
  property. That allows old captured type approximator use new captured types.

That change fixes tests related to diagnostics:
- SETTER_PROJECTED_OUT
- DEBUG_INFO_UNRESOLVED_WITH_TARGET
- UNRESOLVED_REFERENCE_WRONG_RECEIVER

Also `typeProjection` property renamed to `projection` according to naming in NI.
2019-01-24 10:53:58 +03:00

18 lines
374 B
Kotlin
Vendored

// !WITH_NEW_INFERENCE
// NI_EXPECTED_FILE
// See KT-13401: SOE in VarianceChecker
interface Rec<T: Rec<T>> {
fun t(): T
}
interface Super<out U> {
fun foo(p: Rec<*>) = p.t()
}
// Related variance errors
class Owner<in T> {
inner class Inner<U : <!TYPE_VARIANCE_CONFLICT!>T<!>>(val u: U) {
fun getT() = u
}
fun foo(arg: Inner<*>) = arg.getT()
}