is there a way to specify an invariant function ty...
# announcements
r
is there a way to specify an invariant function type? Consider the following, how can I prevent that
a
can be passed (due to the fact that A is less specific than B):
Copy code
interface A
interface B: A
fun foo(b: (B) -> Unit){}
fun test(){
    val a: (A) -> Unit = {}
    foo(a)
}