mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-10 15:53:46 +00:00
12 lines
299 B
Kotlin
Vendored
12 lines
299 B
Kotlin
Vendored
// IGNORE_BACKEND_FIR: JVM_IR
|
|
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()
|