Replace some FIR syntax errors with more proper diagnostics

This commit is contained in:
Mikhail Glukhikh
2020-03-24 19:33:34 +03:00
parent 2f63c8a46a
commit b27152f903
53 changed files with 339 additions and 320 deletions
@@ -139,8 +139,8 @@ object ImplementationConfigurator : AbstractFirTreeImplementationConfigurator()
impl(errorLoop) {
default("block", "FirEmptyExpressionBlock()")
default("condition", "FirErrorExpressionImpl(source, diagnostic)")
useTypes(emptyExpressionBlock)
default("condition", "FirErrorExpressionImpl(source, ConeStubDiagnostic(diagnostic))")
useTypes(emptyExpressionBlock, coneStubDiagnosticType)
}
impl(expression, "FirExpressionStub") {
@@ -390,8 +390,8 @@ object ImplementationConfigurator : AbstractFirTreeImplementationConfigurator()
impl(errorExpression) {
defaultEmptyList("annotations")
default("typeRef", "FirErrorTypeRefImpl(source, diagnostic)")
useTypes(errorTypeRefImpl)
default("typeRef", "FirErrorTypeRefImpl(source, ConeStubDiagnostic(diagnostic))")
useTypes(errorTypeRefImpl, coneStubDiagnosticType)
}
impl(resolvedFunctionTypeRef) {
@@ -65,6 +65,7 @@ val pureAbstractElementType = generatedType("FirPureAbstractElement")
val effectDeclarationType = type("fir.contracts.description", "ConeEffectDeclaration")
val emptyContractDescriptionType = generatedType("contracts.impl", "FirEmptyContractDescription")
val coneDiagnosticType = generatedType("diagnostics", "ConeDiagnostic")
val coneStubDiagnosticType = generatedType("diagnostics", "ConeStubDiagnostic")
val dslBuilderAnnotationType = generatedType("builder", "FirBuilderDsl")
val firImplementationDetailType = generatedType("FirImplementationDetail")