okkero
02/07/2017, 10:46 AMfun foo(a: ClassA) {
val b: ClassA.ClassB = with(a) {
object : ClassA.ClassB() {
}
}
println(b)
}
Given the above code, IDEA does not complain, but the compiler throws an internal error when trying to compile it.
This may be a bug...Andreas Sinz
02/07/2017, 7:34 PMClassA.ClassB()
is not possible at all. you need an instance of ClassA
to create a ClassB
okkero
02/07/2017, 7:37 PMwith(a)
. In the lambda following it the receiver is an instance of ClassA
. This should not be a problem.Andreas Sinz
02/07/2017, 8:00 PMobject: ClassA.ClassB()
get the instance from? implicitly?okkero
02/07/2017, 8:07 PMAndreas Sinz
02/07/2017, 8:14 PM