Change "most specific return type" definition for fake overrides.
Given overridden descriptors D = d[i]. 1. Find D*, subset of D: returnType(d* from D*) <: returnType(d) for each d from D. Always prefer var to val. 2. Prefer non-flexible return type to flexible. Check for var/val overrides properly (NB: this will report PROPERTY_TYPE_MISMATCH_ON_OVERRIDE for all properties, not just overrides involving vars as it was before).
This commit is contained in:
@@ -11360,6 +11360,12 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("genericWithUpperBound.kt")
|
||||
public void testGenericWithUpperBound() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/override/clashesOnInheritance/genericWithUpperBound.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("returnTypeMismatch.kt")
|
||||
public void testReturnTypeMismatch() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/override/clashesOnInheritance/returnTypeMismatch.kt");
|
||||
|
||||
Reference in New Issue
Block a user