Upgrading kotlin 0.9 project to 1.0.1 .. help!


#1

I can’t figure how to fix these compilation errors:

javaClass()
error: Kotlin: Unresolved reference: javaClass

val myEvent: Event = Event()
myEvent += { (e: MyType): Unit -> printMyType(e) }
error: “e: is unexpected token”


#2

Use SomeType::class.java instead of javaClass<SomeType>.

No parentheses around parameters of lambda is required, rewrite as:

myEvent += { e: MyType -> printMyType(e) }

or

myEvent += { printMyType(it) }

#3

worked. many many 10x!!