Fix for a problem with smart cast impossible in a situation when it's not needed. A test for KT-3572. #KT-3572 Fixed.

This commit is contained in:
Mikhail Glukhikh
2015-04-30 11:50:38 +03:00
parent 093878bd06
commit f4dd685bbe
5 changed files with 59 additions and 7 deletions
@@ -0,0 +1,17 @@
trait 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()
}
}