Variance checker: add check for nested local / anonymous classes

So #KT-16136 Fixed
This commit is contained in:
Mikhail Glukhikh
2017-04-21 16:12:18 +03:00
committed by Mikhail Glukhikh
parent 9dd217eee3
commit b66401a41d
2 changed files with 29 additions and 0 deletions
@@ -0,0 +1,26 @@
class C<T> {
private val blah = object {
fun foo(): T = TODO()
}
fun bar(x: T) {}
}
class CC<T> {
fun some(a: Any = object {
fun bar(): T = TODO()
}) {}
fun baz(arg: T) {}
}
interface G
class CCC<T> : G by object : G {
fun some(a: Any = object {
fun bar(): T = null!!
}) {}
} {
fun baz(arg: T) {}
}