Tests for KT-3646: Wrong this in closure for extension function in constructor
#KT-3646 Obsolete
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
fun test(cl: Int.() -> Int):Int = 11.cl()
|
||||
|
||||
class Foo {
|
||||
val a = test { this }
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
if (Foo().a != 11) return "fail"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
@@ -2119,6 +2119,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
doTest("compiler/testData/codegen/box/extensionFunctions/kt1953_class.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt3646.kt")
|
||||
public void testKt3646() throws Exception {
|
||||
doTest("compiler/testData/codegen/box/extensionFunctions/kt3646.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt4118.kt")
|
||||
public void testKt4118() throws Exception {
|
||||
doTest("compiler/testData/codegen/box/extensionFunctions/kt4118.kt");
|
||||
|
||||
Reference in New Issue
Block a user