[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
|
moduleData = baseModuleData
|
||||||
origin = FirDeclarationOrigin.Source
|
origin = FirDeclarationOrigin.Source
|
||||||
symbol = FirCodeFragmentSymbol()
|
symbol = FirCodeFragmentSymbol()
|
||||||
block = when (file) {
|
block = buildOrLazyBlock {
|
||||||
is KtExpressionCodeFragment -> file.getContentElement()?.toFirBlock() ?: buildEmptyExpressionBlock()
|
when (file) {
|
||||||
is KtBlockCodeFragment -> configureBlockWithoutBuilding(file.getContentElement()).build()
|
is KtExpressionCodeFragment -> file.getContentElement()?.toFirBlock() ?: buildEmptyExpressionBlock()
|
||||||
else -> error("Unexpected code fragment type: ${file::class}")
|
is KtBlockCodeFragment -> configureBlockWithoutBuilding(file.getContentElement()).build()
|
||||||
|
else -> error("Unexpected code fragment type: ${file::class}")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user