[FIR] Fix mutant extension function types

Consider the following example from
`extensionLambdasAndArrow.kt`:

```
val x4: String.() -> String = if (true) {
    { str: String -> "this" }
} else {
    { str: String -> "this" }
}
```

Because of
`coerceFirstParameterToExtensionReceiver`
the given lambdas must be of the type
`String.() -> String`, but because of a bug
they are `String.(String) -> String`. At the
same time, during inference their expected
types are, indeed, calculated correctly as
`String.() -> String`.

^KT-59394 Declined
(no more compiler crashes, #potential-feature)
This commit is contained in:
Nikolay Lunyak
2023-07-13 14:55:06 +03:00
committed by Space Team
parent bca44e5d8c
commit 9850987415
11 changed files with 96 additions and 20 deletions
@@ -15377,6 +15377,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
runTest("compiler/testData/codegen/box/fir/emptyIntersectionWarning.kt");
}
@TestMetadata("selectingLambdas.kt")
public void ignoreSelectingLambdas() throws Exception {
runTest("compiler/testData/codegen/box/fir/selectingLambdas.kt");
}
@TestMetadata("typeParameterInClashingAccessor.kt")
public void ignoreTypeParameterInClashingAccessor() throws Exception {
runTest("compiler/testData/codegen/box/fir/typeParameterInClashingAccessor.kt");