Obsolete KT-1776: Can't resolve members of auto-casted "this" in extension without typing "this" explicitly

#KT-1776 Obsolete
This commit is contained in:
Michael Bogdanov
2014-10-07 15:51:06 +04:00
parent 278e682595
commit 6b336be10c
2 changed files with 26 additions and 0 deletions
@@ -0,0 +1,20 @@
trait Expr {
public fun ttFun() : Int = 12
}
class Num(val value : Int) : Expr
fun Expr.sometest() : Int {
if (this is Num) {
value
return value
}
return 0;
}
fun box() : String {
if (Num(11).sometest() != 11) return "fail ${Num(11).sometest()}"
return "OK"
}