K2: Propagate explicit getter type to the property without initializer

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
This commit is contained in:
Denis.Zharkov
2023-02-20 16:53:33 +01:00
committed by Space Team
parent c09607c791
commit 3f052af517
10 changed files with 96 additions and 20 deletions
@@ -262,6 +262,9 @@ sealed class KtFakeSourceElementKind(final override val shouldSkipErrorTypeRepor
// Synthetic calls for if/when/try/etc.
object SyntheticCall : KtFakeSourceElementKind()
// When property doesn't have an initializer and explicit return type, but its getter's return type is specified
object PropertyTypeFromGetterReturnType : KtFakeSourceElementKind()
}
sealed class AbstractKtSourceElement {