Files
kotlin-fork/compiler/testData/diagnostics/tests/smartCasts/kt3572.kt
T
2015-05-12 19:43:17 +02:00

17 lines
313 B
Kotlin
Vendored

interface Printer {
fun print()
}
class OKPrinter : Printer {
override fun print() { }
}
class MyClass(var printer: Printer)
fun main(m: MyClass) {
if (m.printer is OKPrinter) {
// We do not need smart cast here, so we should not get SMARTCAST_IMPOSSIBLE
m.printer.print()
}
}