[FIR] add missed diagnostics for incomplete code
^KT-55053
This commit is contained in:
+1
@@ -0,0 +1 @@
|
||||
<expr>val p: String by</expr>
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
KT element: KtProperty
|
||||
FIR element: FirPropertyImpl
|
||||
FIR source kind: KtRealSourceElementKind
|
||||
|
||||
FIR element rendered:
|
||||
public final val p: R|kotlin/String|by ERROR_EXPR(Should have delegate)
|
||||
public get(): R|kotlin/String| {
|
||||
^ D|/p|.<Unresolved name: getValue>#(Null(null), ::R|/p|)
|
||||
}
|
||||
+6
@@ -579,6 +579,12 @@ public class OutOfContentRootGetOrBuildFirTestGenerated extends AbstractOutOfCon
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/low-level-api-fir/testdata/getOrBuildFir/invalidCode"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("delegatedProperty.kt")
|
||||
public void testDelegatedProperty() throws Exception {
|
||||
runTest("analysis/low-level-api-fir/testdata/getOrBuildFir/invalidCode/delegatedProperty.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("javaClassLiteral.kt")
|
||||
public void testJavaClassLiteral() throws Exception {
|
||||
|
||||
+6
@@ -579,6 +579,12 @@ public class SourceGetOrBuildFirTestGenerated extends AbstractSourceGetOrBuildFi
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/low-level-api-fir/testdata/getOrBuildFir/invalidCode"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("delegatedProperty.kt")
|
||||
public void testDelegatedProperty() throws Exception {
|
||||
runTest("analysis/low-level-api-fir/testdata/getOrBuildFir/invalidCode/delegatedProperty.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("javaClassLiteral.kt")
|
||||
public void testJavaClassLiteral() throws Exception {
|
||||
|
||||
@@ -1814,7 +1814,9 @@ open class RawFirBuilder(
|
||||
buildOrLazyExpression(expression.toFirSourceElement()) {
|
||||
expression.toFirExpression("Should have delegate")
|
||||
}
|
||||
} ?: buildErrorExpression { ConeSimpleDiagnostic("Should have delegate", DiagnosticKind.ExpressionExpected) }
|
||||
} ?: buildErrorExpression {
|
||||
diagnostic = ConeSimpleDiagnostic("Should have delegate", DiagnosticKind.ExpressionExpected)
|
||||
}
|
||||
|
||||
val delegateBuilder = FirWrappedDelegateExpressionBuilder().apply {
|
||||
val delegateExpression = extractDelegateExpression()
|
||||
|
||||
Reference in New Issue
Block a user