[FIR] Create 'FirCodeFragment' with a lazy block if requested
This commit is contained in:
+6
-4
@@ -1197,10 +1197,12 @@ open class PsiRawFirBuilder(
|
||||
moduleData = baseModuleData
|
||||
origin = FirDeclarationOrigin.Source
|
||||
symbol = FirCodeFragmentSymbol()
|
||||
block = when (file) {
|
||||
is KtExpressionCodeFragment -> file.getContentElement()?.toFirBlock() ?: buildEmptyExpressionBlock()
|
||||
is KtBlockCodeFragment -> configureBlockWithoutBuilding(file.getContentElement()).build()
|
||||
else -> error("Unexpected code fragment type: ${file::class}")
|
||||
block = buildOrLazyBlock {
|
||||
when (file) {
|
||||
is KtExpressionCodeFragment -> file.getContentElement()?.toFirBlock() ?: buildEmptyExpressionBlock()
|
||||
is KtBlockCodeFragment -> configureBlockWithoutBuilding(file.getContentElement()).build()
|
||||
else -> error("Unexpected code fragment type: ${file::class}")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user