Add variance (in / out) modifier inspection #KT-11090 Fixed

This commit is contained in:
Mikhail Glukhikh
2016-04-01 17:59:47 +03:00
parent 7c02a1eaad
commit 1b9c6e0ea2
15 changed files with 224 additions and 2 deletions
+24
View File
@@ -0,0 +1,24 @@
interface EffectivelyOut<T> {
fun foo(): T
val bar: T
}
interface EffectivelyIn<T> {
fun foo(arg: T)
}
interface Invariant1<T> {
var bar: T
}
interface Invariant2<T> {
fun T.foo(): T
}
interface Invariant3<T : Invariant1<T>> {
fun T.foo()
}
abstract class AbstractOut<T> {
abstract val foo: T
private var bar = foo
}
abstract class AbstractIn<T>(private val foo: T) {
fun bar(arg: T) = foo == arg
}
interface Empty<T>