3f052af517
In K1, we have the rules like: - if there's explicit type of a property, then use it - if there's an initializer, obtain its expression-type - Otherwise, use getter's return type The case when getter's type is implicit is handled at FirDeclarationsResolveTransformer.transformProperty ^KT-56707 Fixed
14 lines
397 B
Kotlin
Vendored
14 lines
397 B
Kotlin
Vendored
// FIR_IDENTICAL
|
|
// WITH_STDLIB
|
|
// ISSUE: KT-56707
|
|
|
|
class Foo {
|
|
val children = mutableSetOf<Foo>()
|
|
val allChildren
|
|
get() : Set<Foo> = (children + children.flatMap { it.allChildren }).toSet() // Should not be TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM on `allChildren` reference
|
|
}
|
|
|
|
fun use() {
|
|
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Set<Foo>")!>Foo().allChildren<!>
|
|
}
|