From 74df1208ae3b814214078737d4047aa50d41a4a9 Mon Sep 17 00:00:00 2001 From: Zalim Bashorov Date: Fri, 13 Jul 2018 20:06:49 +0300 Subject: [PATCH] Make "localClassCaptureExtensionReceiver" test more robust and mute it for JS IR BE --- .../localClassCaptureExtensionReceiver.kt | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/compiler/testData/codegen/box/localClasses/localClassCaptureExtensionReceiver.kt b/compiler/testData/codegen/box/localClasses/localClassCaptureExtensionReceiver.kt index 732a25ea98b..e7462829efa 100644 --- a/compiler/testData/codegen/box/localClasses/localClassCaptureExtensionReceiver.kt +++ b/compiler/testData/codegen/box/localClasses/localClassCaptureExtensionReceiver.kt @@ -1,15 +1,25 @@ // IGNORE_BACKEND: JVM_IR +// IGNORE_BACKEND: JS_IR class Outer { + val foo = "Foo" + fun String.id(): String { class Local(unused: Long) { fun result() = this@id fun outer() = this@Outer } - return Local(42L).result() + val l = Local(42L) + return l.result() + l.outer().foo } fun result(): String = "OK".id() } -fun box() = Outer().result() +fun box(): String { + val r = Outer().result() + + if (r != "OKFoo") return "Fail: $r" + + return "OK" +}