mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
Otherwise some tools break (e.g. CheckMethodAdapter in ASM, used in generic signature writer) because they expect class names to be Java identifiers. Some tests fixed, some will be fixed in future commits
36 lines
756 B
Kotlin
36 lines
756 B
Kotlin
package abc.foo
|
|
|
|
enum class Season {
|
|
WINTER
|
|
SPRING
|
|
SUMMER
|
|
AUTUMN
|
|
}
|
|
|
|
class A {
|
|
public fun bar1(x : Season) : String {
|
|
when (x) {
|
|
Season.WINTER, Season.SPRING -> return "winter_spring"
|
|
Season.SPRING -> return "spring"
|
|
Season.SUMMER -> return "summer"
|
|
}
|
|
|
|
return "autumn";
|
|
}
|
|
|
|
public fun bar2(y : Season) : String {
|
|
return bar3(y) { x ->
|
|
when (x) {
|
|
Season.WINTER, Season.SPRING -> "winter_spring"
|
|
Season.SPRING -> "spring"
|
|
Season.SUMMER -> "summer"
|
|
else -> "autumn"
|
|
}
|
|
}
|
|
}
|
|
|
|
private fun bar3(x : Season, block : (Season) -> String) = block(x)
|
|
}
|
|
|
|
// 2 TABLESWITCH
|