There are three test entry points:
* [doTestByMainFile] – test cases with dedicated main file.
Supports everything from single-file cases to multi-platform multi-module
multi-file cases
* [doTestByMainModuleAndOptionalMainFile] – test cases rather around
modules than files
* [doTestByModuleStructure] – all other cases with fully custom logic
Look at the KDoc of the corresponding method for more details.
^KT-64805 Fixed
The trove4j library is licensed under LGPL, and that causes some troubles while working with it. The fastutil library provides the same functionality in the context of our needs, and is licensed under the Apache license.
^KTI-1135 In Progress
It affects the `is IrGetField` check in
TypeOperatorLowering.computeNotNullAssertionText, which leads to missing
NPE messages when accessing backing fields of public properties.
#KT-64615
- KT-62895 cannot be reproduced on the Analysis API side. Still, it is
useful to add tests here for better coverage in the future.
- The reason is likely that Analysis API tests specifically use
`SealedClassesInheritorsCaclulatorPreAnalysisHandler` to compute
sealed class inheritors (which are usually the breaking point for
problems in `when` exhaustiveness checking), so the tests do not use
the production implementation. See KT-64505 for future work on this
problem.
^KT-62895
- In dangling file tests, the project structure's main module is a
non-dangling file module. Sealed class inheritors are registered for
that module. However, later when sealed class inheritors are
requested, the FIR class has a dangling file module as its `KtModule`,
which isn't known by the inheritors provider. We need to take the
sealed inheritors of the context module instead.
- `TestModuleStructureFactory.createProjectStructureByTestStructure`
created `KtModule`s for each test module and then also created new
`KtModule`s for binary dependencies. This split worked as long as no
binary dependency was also a test module and thus part of the main
modules. But if not, `addLibraryDependencies` created a duplicate
`KtModule`, instead of referring to the existing binary module.
- The fix registers a main binary library module in the library cache
before it can become the dependency of another main module. Because
main modules can only depend on main modules preceding them in the
list, a separate pass over all main modules is not needed.
^KT-64647 fixed
^KT-59938 Fixed
Review: https://jetbrains.team/p/kt/reviews/13760
After this patch:
> The /compiler/testData/diagnostics/tests/multiplatform/topLevelFun/conflictingImplDeclarations.kt test:
Fixed
> The /compiler/testData/diagnostics/tests/multiplatform/headerClass/expectDeclarationWithWeakIncompatibilities.kt test:
Declarations are in the same module. `PACKAGE_OR_CLASSIFIER_REDECLARATION` is reported anyway
> The /compiler/testData/diagnostics/tests/multiplatform/java/varPropertyAgainstJavaGetterAndNonFinalField.kt test:
Expect-actual matcher doesn't match fields in K2 https://youtrack.jetbrains.com/issue/KT-63667 => green code
> The /compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstJavaPrivateFieldAndPublicMethod.kt test:
Expect-actual matcher doesn't match fields in K2 https://youtrack.jetbrains.com/issue/KT-63667 => green code
> The /compiler/testData/diagnostics/tests/multiplatform/java/implicitJavaActualization_multipleActuals.kt test:
K2 doesn't have implicit Java actualization. And PACKAGE_OR_CLASSIFIER_REDECLARATION is reported anyway
> The /compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstJavaPublicFieldAndPublicGetter.kt test:
Expect-actual matcher doesn't match fields in K2 https://youtrack.jetbrains.com/issue/KT-63667 => green code
> The /compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectContextReceiverOverload.kt test:
Context receivers are not supported in expect-actual matcher. https://youtrack.jetbrains.com/issue/KT-61447
And K2 reports another error right now anyway
Motivation: AMBIGUOUS_ACTUALS can't be reported on frontend (because it
requires expect to actual mapping, but the mapping is only available on
backend)
In scope of KT-59938
Review: https://jetbrains.team/p/kt/reviews/13760
This way, even if the whole qualifier is not selected, but some of its
parts are, the reference shortener will correctly find and shorten
those parts
^KTIJ-28080 Fixed
^KT-58765
Now that JDK 21 was released as stable, we can remove separate test
configurations for testing the compiler with JDK 21 and reintegrate
the corresponding test data into standard test configurations.
This was never semantically correct, but was not important
before KT-63644, as they were immediately dropped after that anyway.
After KT-63644, they were used to compute fake overrides inside them,
which were later matched against actual class, which can
produce false-positive matching errors.
^KT-64835
It was decided to leave this code as is, because supporting
it would probably require introducing Implication-statements,
but this is not a good-enough use-case for such work.