FIR: introduce FirLazyBlock node
This commit is contained in:
+2
-2
@@ -47,8 +47,8 @@ object FieldSets {
|
||||
fun symbol(symbolClassName: String, argument: String? = null): Field =
|
||||
symbolWithPackage("fir.symbols.impl", symbolClassName, argument)
|
||||
|
||||
fun body(nullable: Boolean = false) =
|
||||
field("body", block, nullable)
|
||||
fun body(nullable: Boolean = false, withReplace: Boolean = false) =
|
||||
field("body", block, nullable, withReplace = withReplace)
|
||||
|
||||
val returnTypeRef =
|
||||
field("returnTypeRef", typeRef)
|
||||
|
||||
+17
@@ -113,6 +113,23 @@ object ImplementationConfigurator : AbstractFirTreeImplementationConfigurator()
|
||||
publicImplementation()
|
||||
}
|
||||
|
||||
impl(block, "FirLazyBlock") {
|
||||
val error = """error("FirLazyBlock should be calculated before accessing")"""
|
||||
default("statements") {
|
||||
value = error
|
||||
withGetter = true
|
||||
}
|
||||
default("annotations") {
|
||||
value = error
|
||||
withGetter = true
|
||||
}
|
||||
default("typeRef") {
|
||||
value = error
|
||||
withGetter = true
|
||||
}
|
||||
publicImplementation()
|
||||
}
|
||||
|
||||
impl(errorLoop) {
|
||||
default("block", "FirEmptyExpressionBlock()")
|
||||
default("condition", "FirErrorExpressionImpl(source, ConeStubDiagnostic(diagnostic))")
|
||||
|
||||
+1
-1
@@ -102,7 +102,7 @@ object NodeConfigurator : AbstractFieldConfigurator<FirTreeBuilder>(FirTreeBuild
|
||||
parentArg(callableDeclaration, "F", "F")
|
||||
+symbol("FirFunctionSymbol", "F")
|
||||
+fieldList(valueParameter, withReplace = true).withTransform()
|
||||
+body(nullable = true).withTransform()
|
||||
+body(nullable = true, withReplace = true).withTransform()
|
||||
}
|
||||
|
||||
errorFunction.configure {
|
||||
|
||||
Reference in New Issue
Block a user