class A { val x = arrayListOf<(A<>) -> Unit>() // Here we got an exception during type comparison fun foo(){ x.add {} } }