Tests for obsolete KT-5232: vfy error with default parameter in method of trait
#KT-5232 Obsolete
This commit is contained in:
@@ -0,0 +1,14 @@
|
|||||||
|
trait A {
|
||||||
|
fun visit(a:String, b:String="") : String = b + a
|
||||||
|
}
|
||||||
|
|
||||||
|
class B : A {
|
||||||
|
override fun visit(a:String, b:String) : String = b + a
|
||||||
|
}
|
||||||
|
|
||||||
|
fun box(): String {
|
||||||
|
val result = B().visit("K", "O")
|
||||||
|
if (result != "OK") return "fail $result"
|
||||||
|
|
||||||
|
return B().visit("OK")
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
trait A {
|
||||||
|
fun visit(a:Int, b:String="") : String = b + a
|
||||||
|
}
|
||||||
|
|
||||||
|
class B : A {
|
||||||
|
override fun visit(a:Int, b:String) : String = b + a
|
||||||
|
}
|
||||||
|
|
||||||
|
class C : A {
|
||||||
|
<!NOTHING_TO_OVERRIDE!>override<!> fun visit(a:Int) : String = "" + a
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package
|
||||||
|
|
||||||
|
internal interface A {
|
||||||
|
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||||
|
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||||
|
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||||
|
internal open fun visit(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.String = ...): kotlin.String
|
||||||
|
}
|
||||||
|
|
||||||
|
internal final class B : A {
|
||||||
|
public constructor B()
|
||||||
|
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||||
|
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||||
|
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||||
|
internal open override /*1*/ fun visit(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.String = ...): kotlin.String
|
||||||
|
}
|
||||||
|
|
||||||
|
internal final class C : A {
|
||||||
|
public constructor C()
|
||||||
|
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||||
|
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||||
|
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||||
|
internal open fun visit(/*0*/ a: kotlin.Int): kotlin.String
|
||||||
|
internal open override /*1*/ /*fake_override*/ fun visit(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.String = ...): kotlin.String
|
||||||
|
}
|
||||||
@@ -3106,6 +3106,21 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("compiler/testData/diagnostics/tests/defaultArguments")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
|
public static class DefaultArguments extends AbstractJetDiagnosticsTest {
|
||||||
|
public void testAllFilesPresentInDefaultArguments() throws Exception {
|
||||||
|
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/tests/defaultArguments"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("kt5232.kt")
|
||||||
|
public void testKt5232() throws Exception {
|
||||||
|
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/defaultArguments/kt5232.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/diagnostics/tests/delegatedProperty")
|
@TestMetadata("compiler/testData/diagnostics/tests/delegatedProperty")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
|
|||||||
+6
@@ -2373,6 +2373,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("kt5232.kt")
|
||||||
|
public void testKt5232() throws Exception {
|
||||||
|
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/box/defaultArguments/function/kt5232.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("memberFunctionManyArgs.kt")
|
@TestMetadata("memberFunctionManyArgs.kt")
|
||||||
public void testMemberFunctionManyArgs() throws Exception {
|
public void testMemberFunctionManyArgs() throws Exception {
|
||||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/box/defaultArguments/function/memberFunctionManyArgs.kt");
|
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/box/defaultArguments/function/memberFunctionManyArgs.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user