-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The problem is caused by `FirExpression.tryToSetSourceForImplicitReceiver()`: at some point a smartcast expression is instantiated with an `originalExpression` with no source, but later it's replaced with a one that does have a one, which leads to inconsistency. Also the receiver expression may have `null` source instead of a fake source, which can also make `FirJvmModuleAccessibilityTypeChecker` fail. The change in `FirElementsRecorder` is backed by: `K2HighlightingMetaInfoTestGenerated.testImplicitAndExplicit_functions` (otherwise `descr='Implicit receiver smart cast to Foo'` is replaced with `descr='Smart cast to Foo'`), as well as: - `testImplicitAndExplicit_operators` - `testImplicitAndExplicit_properties` - `testImplicit_stable` and `K2IdeK2CodeKotlinSteppingTestGenerated$Custom.testSmartStepIntoInterfaceImpl`. The new `ImplicitThisReceiverExpression` was introduced, because for some reason assigning non-`-1` offsets to the `IrGetValue` expressions (in `Fir2IrVisitor.generateThisReceiverAccessForCallable`) in `FirLightTreeBlackBoxInlineCodegenWithIrInlinerTestGenerated.testAnonymousObjectInCallChildren` leads to incorrect SMAP generation: when in `AbstractClassBuilder.visitSMAP`, we can see that some `RangeMapping` are incorrect in a sence that this code doesn't expect them to be like this for some reason. This is important because it also affects the following pair of tests in intelij: - `K1IdeK2CodeKotlinSteppingTestGenerated.StepInto#testKotlinSamFunction` - `K1IdeK2CodeKotlinSteppingTestGenerated.SmartStepInto#testKotlinSamFunction` These tests under the hood rely on a single test file, and with such line numbers it's impossible to satisfy them both at once: they produce 2 contradicting changes. Namely, the first one leads to: ``` kotlinSamFunction.kt:15 kotlinSamFunction.kt:6 resuming kotlinSamFunction.kt:15 Disconnected from the target VM ``` ...while the second one - to: ``` kotlinSamFunction.kt:15 kotlinSamFunction.kt:15 Disconnected from the target VM ``` ^KT-67469 Fixed
- Loading branch information
1 parent
4409bb7
commit 8049cf9
Showing
8 changed files
with
34 additions
and
160 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.