Fix variance problems.

This commit is contained in:
Stanislav Erokhin
2014-08-27 17:13:00 +04:00
parent c10c1ad7f6
commit 65c9ea2465
15 changed files with 25 additions and 25 deletions
@@ -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()
}
}