mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-16 15:53:55 +00:00
39 lines
517 B
Kotlin
Vendored
39 lines
517 B
Kotlin
Vendored
fun testBinary1() {
|
|
operator fun Int.times(s: String) {}
|
|
|
|
todo() * ""
|
|
}
|
|
fun testBinary2() {
|
|
"1" + todo()
|
|
}
|
|
|
|
fun testElvis1() {
|
|
todo() ?: ""
|
|
}
|
|
|
|
fun testElvis2(s: String?) {
|
|
s ?: todo()
|
|
|
|
bar()
|
|
}
|
|
|
|
fun testAnd1(b: Boolean) {
|
|
b && todo()
|
|
|
|
bar()
|
|
}
|
|
|
|
fun testAnd2(b: Boolean) {
|
|
todo() && b
|
|
}
|
|
|
|
fun returnInBinary1(): Boolean {
|
|
(return true) && (return false)
|
|
}
|
|
|
|
fun returnInBinary2(): Boolean {
|
|
(return true) || (return false)
|
|
}
|
|
|
|
fun todo(): Nothing = throw Exception()
|
|
fun bar() {} |