KT-7689 Wrong error message format for type of ... doesn't match to the type of overridden var-property

#KT-7689 Fixed
This commit is contained in:
Andrey Breslav
2015-05-18 13:37:06 +03:00
parent fdf0ea5546
commit df6c20efa4
3 changed files with 20 additions and 2 deletions
@@ -0,0 +1,12 @@
interface Base {
fun foo(): Int
var bar: Int
}
class Derived : Base {
override fun foo(): <error descr="[RETURN_TYPE_MISMATCH_ON_OVERRIDE] Return type of 'foo' is not a subtype of the return type of the overridden member 'internal abstract fun foo(): kotlin.Int defined in Base'">String</error> = ""
override var bar: <error descr="[PROPERTY_TYPE_MISMATCH_ON_OVERRIDE] Type of 'bar' doesn't match the type of the overridden var-property 'internal abstract var bar: kotlin.Int defined in Base'">String</error> = ""
}
@@ -283,6 +283,12 @@ public class JetPsiCheckerTestGenerated extends AbstractJetPsiCheckerTest {
doTest(fileName);
}
@TestMetadata("ReturnTypeMismatchOnOverride.kt")
public void testReturnTypeMismatchOnOverride() throws Exception {
String fileName = JetTestUtils.navigationMetadata("idea/testData/checker/ReturnTypeMismatchOnOverride.kt");
doTest(fileName);
}
@TestMetadata("Shadowing.kt")
public void testShadowing() throws Exception {
String fileName = JetTestUtils.navigationMetadata("idea/testData/checker/Shadowing.kt");