fun main() {
doSomething()
doSomeThing()
}
fun f(block: () -> Unit) {
block()
}
fun doSomething() {
f { println("doSomething") }
}
fun doSomeThing() {
f { println("doSomeThing") }
}
What's the output on Windows?
1.
doSomething
doSomeThing
2.
doSomething
doSomething
3.
doSomeThing
doSomething
4.
doSomeThing
doSomeThing
5.
java.lang.NoClassDefFoundError
Expand
```
java.lang.NoClassDefFoundError: MainKt$doSomething$1 (wrong name: MainKt$doSomeThing$1)
at Main.doSomething(Main.kt:11)
```
Encountered in Kotlin 1.4.32, verified fixed in 1.6.0 (not sure about 1.5.x)
On 1.6.0 two class files are generated: `MainKt$doSomething$1` and `MainKt$doSomeThing$2`
On Unix this is not an issue because most file systems are case sensitive.
What's the output on Windows?
1.
2.
3.
4.
5.
Expand
``` java.lang.NoClassDefFoundError: MainKt$doSomething$1 (wrong name: MainKt$doSomeThing$1) at Main.doSomething(Main.kt:11) ``` Encountered in Kotlin 1.4.32, verified fixed in 1.6.0 (not sure about 1.5.x) On 1.6.0 two class files are generated: `MainKt$doSomething$1` and `MainKt$doSomeThing$2` On Unix this is not an issue because most file systems are case sensitive.