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:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user