JVM IR: do not attempt to mangle function expressions

For some reasons, lambdas and function expressions are represented
slightly differently in psi2ir. Lambdas are translated to a block with a
function of origin LOCAL_FUNCTION_FOR_LAMBDA and name "<anonymous>", but
function expressions are translated to a block with DEFINED function
"<no name provided>".

Tweak the condition for detecting local functions a bit, to avoid
similar situation in the future if we add some other origins for local
functions.

 #KT-48207 Fixed
This commit is contained in:
Alexander Udalov
2021-08-11 22:01:04 +02:00
parent dd3eb53904
commit d124239025
10 changed files with 51 additions and 3 deletions
@@ -15364,6 +15364,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
runTest("compiler/testData/codegen/box/inlineClasses/fieldNameClash.kt");
}
@TestMetadata("functionExpression.kt")
public void testFunctionExpression() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/functionExpression.kt");
}
@TestMetadata("genericInlineClassSynthMembers.kt")
public void testGenericInlineClassSynthMembers() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/genericInlineClassSynthMembers.kt");