[FIR] Source for property delegates should not be null
^KT-60327 fixed Merge-request: KT-MR-13221 Merged-by: Egor Kulikov <Egor.Kulikov@jetbrains.com>
This commit is contained in:
+5
@@ -181,6 +181,11 @@ public class LightTree2FirConverterTestCaseGenerated extends AbstractLightTree2F
|
||||
runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/genericProperty.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("incompletePropertyWithDelegate.kt")
|
||||
public void testIncompletePropertyWithDelegate() throws Exception {
|
||||
runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/incompletePropertyWithDelegate.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("initBlockWithDeclarations.kt")
|
||||
public void testInitBlockWithDeclarations() throws Exception {
|
||||
runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/initBlockWithDeclarations.kt");
|
||||
|
||||
@@ -1976,6 +1976,7 @@ open class PsiRawFirBuilder(
|
||||
val delegateBuilder = FirWrappedDelegateExpressionBuilder().apply {
|
||||
val delegateFirExpression = extractDelegateExpression()
|
||||
source = delegateFirExpression.source?.fakeElement(KtFakeSourceElementKind.WrappedDelegate)
|
||||
?: this@toFirProperty.delegate?.toFirSourceElement(KtFakeSourceElementKind.WrappedDelegate)
|
||||
expression = delegateFirExpression
|
||||
}
|
||||
|
||||
@@ -2042,6 +2043,7 @@ open class PsiRawFirBuilder(
|
||||
val delegateBuilder = FirWrappedDelegateExpressionBuilder().apply {
|
||||
val delegateExpression = extractDelegateExpression()
|
||||
source = delegateExpression.source?.fakeElement(KtFakeSourceElementKind.WrappedDelegate)
|
||||
?: this@toFirProperty.delegate?.toFirSourceElement(KtFakeSourceElementKind.WrappedDelegate)
|
||||
expression = delegateExpression
|
||||
}
|
||||
|
||||
|
||||
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
fun String.getValue(x: Any?, y: KProperty<*>) = ""
|
||||
val x: String by
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
FILE: incompletePropertyWithDelegate.kt
|
||||
public? final? fun String.getValue(x: Any?, y: KProperty<*>): <implicit> { LAZY_BLOCK }
|
||||
public? final? val x: Stringby LAZY_EXPRESSION
|
||||
public? get(): <implicit> { LAZY_BLOCK }
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
FILE: incompletePropertyWithDelegate.kt
|
||||
public? final? fun String.getValue(x: Any?, y: KProperty<*>): <implicit> {
|
||||
^getValue String()
|
||||
}
|
||||
public? final? val x: Stringby ERROR_EXPR(Should have delegate)
|
||||
public? get(): <implicit> {
|
||||
^ D|/x|.getValue#(Null(null), ::R|/x|)
|
||||
}
|
||||
+5
@@ -181,6 +181,11 @@ public class RawFirBuilderLazyBodiesTestCaseGenerated extends AbstractRawFirBuil
|
||||
runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/genericProperty.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("incompletePropertyWithDelegate.kt")
|
||||
public void testIncompletePropertyWithDelegate() throws Exception {
|
||||
runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/incompletePropertyWithDelegate.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("initBlockWithDeclarations.kt")
|
||||
public void testInitBlockWithDeclarations() throws Exception {
|
||||
runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/initBlockWithDeclarations.kt");
|
||||
|
||||
+5
@@ -181,6 +181,11 @@ public class RawFirBuilderTestCaseGenerated extends AbstractRawFirBuilderTestCas
|
||||
runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/genericProperty.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("incompletePropertyWithDelegate.kt")
|
||||
public void testIncompletePropertyWithDelegate() throws Exception {
|
||||
runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/incompletePropertyWithDelegate.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("initBlockWithDeclarations.kt")
|
||||
public void testInitBlockWithDeclarations() throws Exception {
|
||||
runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/initBlockWithDeclarations.kt");
|
||||
|
||||
Reference in New Issue
Block a user