Fix variance problems.
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
// "Cast expression 'x' to 'Foo<Number>'" "true"
|
||||
trait Foo<out T: Number> {
|
||||
fun foo(x: T)
|
||||
// "Cast expression 'x' to 'Foo<out Number>'" "true"
|
||||
trait Foo<T: Number> {
|
||||
fun foo()
|
||||
}
|
||||
|
||||
fun bar(_x: Any) {
|
||||
var x = _x
|
||||
if (x is Foo<*>) {
|
||||
(x as Foo<Number>)<caret>.foo(42)
|
||||
(x as Foo<out Number>)<caret>.foo()
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
// "Cast expression 'x' to 'Foo<Number>'" "true"
|
||||
trait Foo<out T: Number> {
|
||||
fun foo(x: T)
|
||||
// "Cast expression 'x' to 'Foo<out Number>'" "true"
|
||||
trait Foo<T: Number> {
|
||||
fun foo()
|
||||
}
|
||||
|
||||
fun bar(_x: Any) {
|
||||
var x = _x
|
||||
if (x is Foo<*>) {
|
||||
x<caret>.foo(42)
|
||||
x<caret>.foo()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user