Files
kotlin-fork/compiler/testData/diagnostics/tests/inference/regressions/kt34029.kt
T
Pavel Kirpichenkov c21e699783 Fix default type of static classes inside parametrized parents
Default type of LazySubstitutingClassDescriptor is not lazy. However, most of default types are,
and there is an optimization in KotlinTypeFactory, which uses default type for simple type without
type arguments and/or annotations. LazySubstitutingClassDescriptor's default type creates simple type
with factory, which may therefore cause recursion.

#KT-34029 Fixed
2019-10-25 11:59:27 +03:00

7 lines
244 B
Kotlin
Vendored

open class MyClass<T> {
object MyObject : MyClass<Boolean>() { }
}
val foo1 = MyClass.MyObject // it's ok
val foo2 = <!FUNCTION_CALL_EXPECTED!>MyClass<Boolean><!>.<!NESTED_CLASS_ACCESSED_VIA_INSTANCE_REFERENCE!>MyObject<!> // here's stofl