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
+12
@@ -25056,12 +25056,24 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag
|
||||
runTest("compiler/testData/diagnostics/tests/properties/extensionPropertyMustHaveAccessorsOrBeAbstract.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("inferPropertyTypeFromGetter.kt")
|
||||
public void testInferPropertyTypeFromGetter() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/properties/inferPropertyTypeFromGetter.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt47621.kt")
|
||||
public void testKt47621() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/properties/kt47621.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt56707.kt")
|
||||
public void testKt56707() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/properties/kt56707.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("lateinitOnTopLevel.kt")
|
||||
public void testLateinitOnTopLevel() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user