Files
kotlin-fork/compiler/testData/diagnostics/tests/inference/kt32415.kt
T
Pavel Kirpichenkov b6af13f18d [NI] Add missing substitution of known type parameters
Known type parameters appear after inheriting from class with type
parameters. Their substitution matters for inner class constructor,
because without substitution it's parameters will be type checked
against incorrect (original) parameter descriptor with unsubstituted
type parameters.

Skip creation of composite substitutor, if old substitutor is empty.

New substitutors return null in case they don't substitute a type,
but old type substitutors have explicit isEmpty method. Composite
substitutor with empty old substitutor leads to creation
of incorrect descriptor copies.
2019-11-15 16:58:07 +03:00

10 lines
196 B
Kotlin
Vendored

// !LANGUAGE: +NewInference
abstract class TestType<V: Any> {
open inner class Inner(val item: V)
}
class Derived: TestType<Long>() {
inner class DerivedInner(item: Long): Inner(item)
}