Files
kotlin/compiler/testData/diagnostics/tests/inline/when.kt
Dmitry Neverov cd24adac32 Detect redundant 'is' check
#KT-14187 Fixed
2017-05-15 11:24:35 +03:00

11 lines
367 B
Kotlin
Vendored

// !DIAGNOSTICS: -UNUSED_EXPRESSION
inline public fun reg(converter: (Any) -> Any) {
converter("")
}
public inline fun register(converter: (Any) -> Any) {
reg(when(<!USAGE_IS_NOT_INLINABLE!>converter<!>) {
<!USELESS_IS_CHECK!>is (Any) -> Any<!> -> <!USAGE_IS_NOT_INLINABLE!>converter<!>
else -> <!USAGE_IS_NOT_INLINABLE!>converter<!>
})
}