mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 00:21:47 +00:00
39 lines
716 B
Kotlin
Vendored
39 lines
716 B
Kotlin
Vendored
fun testBinary1() {
|
|
operator fun Int.times(<!UNUSED_PARAMETER!>s<!>: String) {}
|
|
|
|
todo() <!UNREACHABLE_CODE!>* ""<!>
|
|
}
|
|
fun testBinary2() {
|
|
"1" <!UNREACHABLE_CODE!>+<!> todo()
|
|
}
|
|
|
|
fun testElvis1() {
|
|
todo() <!USELESS_ELVIS, UNREACHABLE_CODE!>?: ""<!>
|
|
}
|
|
|
|
fun testElvis2(s: String?) {
|
|
s ?: todo()
|
|
|
|
bar()
|
|
}
|
|
|
|
fun testAnd1(b: Boolean) {
|
|
b && todo()
|
|
|
|
bar()
|
|
}
|
|
|
|
fun testAnd2(<!UNUSED_PARAMETER!>b<!>: Boolean) {
|
|
todo() <!UNREACHABLE_CODE!>&& b<!>
|
|
}
|
|
|
|
fun returnInBinary1(): Boolean {
|
|
(return true) <!UNREACHABLE_CODE!>&& (return false)<!>
|
|
}
|
|
|
|
fun returnInBinary2(): Boolean {
|
|
(return true) <!UNREACHABLE_CODE!>|| (return false)<!>
|
|
}
|
|
|
|
fun todo(): Nothing = throw Exception()
|
|
fun bar() {} |