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"
}
@@ -2771,6 +2771,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
doTest(fileName);
}
@TestMetadata("kt1776.kt")
public void testKt1776() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/box/extensionFunctions/kt1776.kt");
doTest(fileName);
}
@TestMetadata("kt1953.kt")
public void testKt1953() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/box/extensionFunctions/kt1953.kt");