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()
|
||||
Reference in New Issue
Block a user