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:
committed by
Space Team
parent
c09607c791
commit
3f052af517
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user