Add tests for obsolete issue
#KT-7412 Obsolete
This commit is contained in:
@@ -0,0 +1,10 @@
|
|||||||
|
open class Foo {
|
||||||
|
open fun foo(x: CharSequence = "O"): CharSequence = x
|
||||||
|
}
|
||||||
|
class Bar(): Foo() {
|
||||||
|
override fun foo(x: CharSequence): String { // Note the covariant return type
|
||||||
|
return x.toString() + "K"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun box() = Bar().foo()
|
||||||
+10
@@ -0,0 +1,10 @@
|
|||||||
|
open class Foo {
|
||||||
|
open fun foo(x: CharSequence = "O"): CharSequence = x
|
||||||
|
}
|
||||||
|
class Bar<T : String>: Foo() {
|
||||||
|
override fun foo(x: CharSequence): T { // Note the covariant return type
|
||||||
|
return (x.toString() + "K") as T
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun box() = Bar<String>().foo()
|
||||||
+12
@@ -2778,6 +2778,18 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("covariantOverride.kt")
|
||||||
|
public void testCovariantOverride() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/defaultArguments/function/covariantOverride.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("covariantOverrideGeneric.kt")
|
||||||
|
public void testCovariantOverrideGeneric() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/defaultArguments/function/covariantOverrideGeneric.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("extensionFunctionManyArgs.kt")
|
@TestMetadata("extensionFunctionManyArgs.kt")
|
||||||
public void testExtensionFunctionManyArgs() throws Exception {
|
public void testExtensionFunctionManyArgs() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/defaultArguments/function/extensionFunctionManyArgs.kt");
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/defaultArguments/function/extensionFunctionManyArgs.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user