[FIR] Transform context receivers on properties during type resolution stage
^KT-53706 Fixed
This commit is contained in:
committed by
teamcity
parent
7ef2f7ccde
commit
66117367ad
+6
@@ -17005,6 +17005,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
|||||||
runTest("compiler/testData/codegen/box/extensionClasses/generics.kt");
|
runTest("compiler/testData/codegen/box/extensionClasses/generics.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("propertyWithContext.kt")
|
||||||
|
public void testPropertyWithContext() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/extensionClasses/propertyWithContext.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("simple.kt")
|
@TestMetadata("simple.kt")
|
||||||
public void testSimple() throws Exception {
|
public void testSimple() throws Exception {
|
||||||
|
|||||||
+1
@@ -120,6 +120,7 @@ open class FirTypeResolveTransformer(
|
|||||||
property.transformTypeParameters(this, data)
|
property.transformTypeParameters(this, data)
|
||||||
.transformReturnTypeRef(this, data)
|
.transformReturnTypeRef(this, data)
|
||||||
.transformReceiverTypeRef(this, data)
|
.transformReceiverTypeRef(this, data)
|
||||||
|
.transformContextReceivers(this, data)
|
||||||
.transformGetter(this, data)
|
.transformGetter(this, data)
|
||||||
.transformSetter(this, data)
|
.transformSetter(this, data)
|
||||||
.transformBackingField(this, data)
|
.transformBackingField(this, data)
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
// LANGUAGE: +ContextReceivers
|
||||||
|
// TARGET_BACKEND: JVM_IR
|
||||||
|
// ISSUE: KT-53706
|
||||||
|
|
||||||
|
fun box(): String {
|
||||||
|
return with(SomeContext()) {
|
||||||
|
"error".foo
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class SomeContext {
|
||||||
|
val value: String = "OK"
|
||||||
|
}
|
||||||
|
|
||||||
|
context(SomeContext)
|
||||||
|
val String.foo: String
|
||||||
|
get() = value
|
||||||
+6
@@ -17005,6 +17005,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
|||||||
runTest("compiler/testData/codegen/box/extensionClasses/generics.kt");
|
runTest("compiler/testData/codegen/box/extensionClasses/generics.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("propertyWithContext.kt")
|
||||||
|
public void testPropertyWithContext() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/extensionClasses/propertyWithContext.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("simple.kt")
|
@TestMetadata("simple.kt")
|
||||||
public void testSimple() throws Exception {
|
public void testSimple() throws Exception {
|
||||||
|
|||||||
Reference in New Issue
Block a user