After `4b8b7aaa` external classes' secondary
constructors should not have a delegated call, so we
don't create a call if there's no explicit call.
But we need to check if there is.
The failing tests were muted in
`8fcf91d8`, and are now unmuted
back. Those are the ones in the
`testData/rawBuilder/declarations`
folder. These tests fail because they supply
PSI stubs for the secondary constructors,
so arbitrary operations (like reading .text of
the delegated constructor call) are not allowed
for them. This commit modifies secondary
constructor stubs to include the
required information.
^KT-65268 Fixed
Merge-request: KT-MR-13982
Merged-by: Nikolay Lunyak <Nikolay.Lunyak@jetbrains.com>
These arguments switch language features which cannot be disabled
anymore because they're enabled from some LV not later than 1.4, and the
minimal supported LV is currently 1.4.
This is kind of another fix for KT-65456, independent from the one in
the previous commit. Here we restore the old behavior of
`buildFakeOverridesForClassUsingOverriddenSymbols`, which is used in
places where fake overrides for static declarations from
superclasses are not necessary at all, such as SAM adapters or
annotation implementation classes.
This reverts commit 6271f5cbe5.
The original commit 15094eb03a was reverted because it caused a problem
during bootstrap. That problem is fixed in a subsequent commit.
To add the file name to the exception message similarly to how it's done
in `PerformByIrFilePhase.invokeSequential`, so that exceptions such as
KT-65277 would be easier to diagnose.
- If we don't override `createModules`, library module creation will
fail with an exception before `SKIP_WHEN_OUT_OF_CONTENT_ROOT` is ever
checked.
- I don't think it makes sense to add library compilation support to
out-of-content-root tests, since out-of-content-root files should not
be able to depend on any library.
^KT-63330
Use `withContainingFirClass` during processing `localClassesCreatedOnTheFly`
Use `withContainingFirClass` in `processLocalClassAndNestedClassesOnTheFly` and `processLocalClassAndNestedClasses`
Since the declarations generated by compiler plugins do not have proper
PSI (`classOrObjectDeclaration` in this case), we need to resort to
symbols for such declarations to compute the proper qualified name
^KT-65425 Fixed
For destructing calls, the component type is used for the property type
in all cases. However, this can result in runtime and/or compilation
errors when the property is a var and changed, especially when the
component is a primitive but the property type is nullable. Instead,
only use the component type when the property is also a val.
^KT-64944 Fixed
This diagnostic is reported on an explicitly-declared function which
overrides a regular Java function with the same signature as a hidden
one from the same scope.
#KT-64846 Fixed
In this commit we started to create and process a hidden copy
for a built-in functions, which value parameters are erased in Java,
in case we have an accidental Java override which value parameters
are not erased.
In this situation attempt to override such a Java override in Kotlin
again will lead to inaccessible functions
(see changes in containsAndOverload.fir.kt)
#KT-64846 In Progress
This change is needed because otherwise, source files that are not Java will be added as `JavaSourceRoot`, this is incorrect and causes assertion error in `com.intellij.core.JavaCoreProjectEnvironment.addSourcesToClasspath`. Refer to KT-65325 for more context.
Merge-request: KT-MR-14088
Merged-by: Xuan Son Trinh <xuanson.trinh@jetbrains.com>
^KT-62547 Fixed
I also tested the commit by disabling DfaBooleanVariables in all tests
and checking what tests will fail
I didn't find anything that worked in K1, but doesn't work in K2 with
DfaBooleanVariables disabled
Related tests:
- DiagnosticCompilerTestFirTestdataTestGenerated$Resolve$Smartcasts
- LLFirPreresolvedReversedDiagnosticCompilerFirTestDataTestGenerated$Resolve$Smartcasts
- PreFirIdeSpecTestGenerated$NotLinked$Dfa
- DiagnosticCompilerTestFE10TestdataTestGenerated$Tests$SmartCasts
- FirPsiDiagnosticTestGenerated$Resolve$Expresssions.testSyntheticSmartCast
... if the delegate happens to be a function call whose second
argument is a callable reference but not actually a provideDelegate
call.
The fix is to ensure that the call is _actually_ a desugared
provideDelegate call.
This fixes a CCE in a case where the delegate expression is a regular
function call and the second argument is a callable reference.
#KT-65165 Fixed