[FIR2IR] Don't use source to determine that function is anonymous

This commit is contained in:
Dmitriy Novozhilov
2022-05-17 20:37:00 +03:00
committed by teamcity
parent 29725ad007
commit 706a0d287a
@@ -496,7 +496,7 @@ class Fir2IrDeclarationStorage(
forceTopLevelPrivate: Boolean = false,
): IrSimpleFunction = convertCatching(function) {
val simpleFunction = function as? FirSimpleFunction
val isLambda = function.source?.elementType.let { it == KtNodeTypes.FUNCTION_LITERAL || it == KtNodeTypes.LAMBDA_EXPRESSION }
val isLambda = function is FirAnonymousFunction && function.isLambda
val updatedOrigin = when {
isLambda -> IrDeclarationOrigin.LOCAL_FUNCTION_FOR_LAMBDA
function.symbol.callableId.isKFunctionInvoke() -> IrDeclarationOrigin.FAKE_OVERRIDE