[LL API] Fix 'this' capturing inside property accessors
^KTIJ-26726 Fixed
This commit is contained in:
+4
-1
@@ -139,7 +139,10 @@ private class CodeFragmentCapturedValueVisitor(
|
||||
register(CodeFragmentCapturedSymbol(capturedValue, symbol, typeRef, contextReceiverNumber))
|
||||
}
|
||||
}
|
||||
is FirFunctionSymbol<*> -> {
|
||||
is FirFunctionSymbol<*>, is FirPropertySymbol -> {
|
||||
@Suppress("USELESS_IS_CHECK") // Smart-cast is not applied from a 'when' condition in K1
|
||||
require(symbol is FirCallableSymbol<*>)
|
||||
|
||||
if (contextReceiverNumber >= 0) {
|
||||
val contextReceiver = symbol.resolvedContextReceivers[contextReceiverNumber]
|
||||
val labelName = contextReceiver.labelName
|
||||
|
||||
+18
@@ -54,6 +54,24 @@ public class CodeFragmentCapturingTestGenerated extends AbstractCodeFragmentCapt
|
||||
runTest("analysis/analysis-api/testData/components/compilerFacility/compilation/codeFragments/capturing/extensionReceiverLabeled.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("extensionReceiverProperty.kt")
|
||||
public void testExtensionReceiverProperty() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/components/compilerFacility/compilation/codeFragments/capturing/extensionReceiverProperty.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("extensionReceiverPropertyExplicit.kt")
|
||||
public void testExtensionReceiverPropertyExplicit() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/components/compilerFacility/compilation/codeFragments/capturing/extensionReceiverPropertyExplicit.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("extensionReceiverPropertyLabeled.kt")
|
||||
public void testExtensionReceiverPropertyLabeled() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/components/compilerFacility/compilation/codeFragments/capturing/extensionReceiverPropertyLabeled.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("initializer.kt")
|
||||
public void testInitializer() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user