K1 reports `ARGUMENT_TYPE_MISMATCH`
and `TOO_MANY_ARGUMENTS` together, and
one way to do it in K2 is to say that
their kinds of inapplicability difference
is not relevant to the user.
Note that K1 doesn't do such filtering,
so this change "makes K2 closer to K1",
but still different.
^KT-62541 Fixed
fixup! [FIR] Show ARGUMENTS_MAPPING_ERROR diagnostics along with INAPPLICABLE
See the `privateInFile.fir.kt` test.
Type mismatches are simply confusing.
`inheritorOfExpectSealedClass.out`
reports unresolved reference probably
because now it resolves into the expect
declaration, rather than the actual one.
K1 doesn't report UNRESOLVED_REFERENCE
in this case. But this is red code
anyway. And this behavior still
depends on the order in which the compiler
receives both the declarations.
^KT-59927
^KT-62567
This is a precondition for obsoleting and finally removing
`-Xexpect-actual-linker` CLI key, which became useless since
the removal of ExpectActualTable.
^KT-61136
The test starts failing after switching to 2.0 because we don't support
TypeInferenceOnCallsWithSelfTypes though it's planned (see KT-59012).
This particular test was introduced in 1.5.x (see KT-48026) to check
if the flag -Xself-upper-bound-inference actually enables
the feature TypeInferenceOnCallsWithSelfTypes.
While the feature is enabled by default since 1.6, it doesn't make sense
to have it with earlier versions.
Another solution would be removing it at all, but that might require
removing related code as well (as we would have some dead code in CLI
arguments processing).
^KT-60885 Fixed
^KT-61573 Fixed
Review: https://jetbrains.team/p/kt/reviews/11969/timeline
Tests:
- MultiPlatformIntegrationTestGenerated
- CliTestGenerated
- MultiPlatformIntegrationTestGenerated
- DiagnosticTestGenerated.Multiplatform
- FirLightTreeOldFrontendDiagnosticsTestGenerated
Also add -Xexpect-actual-classes flag to all necessary ./libraries/* modules
Otherwise compilation of those modules failes because of `-Werror`
Unfortunately, there are still problems with running JVM backend tests
with JVM target 21 because:
1) The D8 version that we use does not support bytecode version 21, and
updating to a newer version requires to change JVM target of compiler
tests to 11. This will be addressed separately when we enable JVM 21
in tests-different-jdk.
2) Some tests are failing because of KT-60659 and KT-60770:
- builtinStubMethods/bridgesForStubs/emptyStringListAdd.kt
- jdk/stream.kt
- regressions/kt528.kt
#KT-60662 Fixed
Do not try to find PSI element, but always use the IR element offsets
instead. This greatly simplifies test data because we don't need to have
custom PSI- and LT- based diagnostic ranges in every test, and K1/K2
behavior also is mostly the same.
The exact offset ranges are not as important for backend diagnostics, so
it's better to have K2+PSI and K2+LT behaving the same.
Compilation crash must be handled separately in
`convertToConstantValues` method because we still want successfully
compile common code. All constants will be evaluated later on
fir2ir phase.
#KT-59362 Fixed