Test return type mismatch on override diagnostic rendering
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
// !DIAGNOSTICS_NUMBER: 2
|
||||
// !DIAGNOSTICS: RETURN_TYPE_MISMATCH_ON_OVERRIDE
|
||||
// !MESSAGE_TYPE: HTML
|
||||
|
||||
package myPackage.a.b
|
||||
|
||||
open class A {
|
||||
open fun f(): kotlin.String = "asd"
|
||||
open fun g(): kotlin.String = "Asd"
|
||||
}
|
||||
|
||||
class B : A() {
|
||||
override fun f(): String = String()
|
||||
override fun g(): kotlin.Int = 3
|
||||
}
|
||||
|
||||
class String
|
||||
@@ -0,0 +1,4 @@
|
||||
<!-- returnTypeMismatchOnOverride1 -->
|
||||
<html>
|
||||
Return type is 'myPackage.a.b.String', which is not a subtype of overridden<br/>
|
||||
<b>public</b> <b>open</b> <b>fun</b> f(): kotlin.String <i>defined in</i> myPackage.a.b.A</html>
|
||||
@@ -0,0 +1,4 @@
|
||||
<!-- returnTypeMismatchOnOverride2 -->
|
||||
<html>
|
||||
Return type is 'Int', which is not a subtype of overridden<br/>
|
||||
<b>public</b> <b>open</b> <b>fun</b> g(): String <i>defined in</i> myPackage.a.b.A</html>
|
||||
@@ -185,6 +185,12 @@ public class DiagnosticMessageTestGenerated extends AbstractDiagnosticMessageTes
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("returnTypeMismatchOnOverride.kt")
|
||||
public void testReturnTypeMismatchOnOverride() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/diagnosticMessage/returnTypeMismatchOnOverride.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("typeInferenceCannotCaptureTypes.kt")
|
||||
public void testTypeInferenceCannotCaptureTypes() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/diagnosticMessage/typeInferenceCannotCaptureTypes.kt");
|
||||
|
||||
Reference in New Issue
Block a user