There's no behavior specific for JVM backend diagnostics in any of the
affected tests, and this code is using an incorrect way to obtain those
diagnostics, so it should be removed anyway.
In 9b5a9ccb `throws Exception` was removed from java test sources and
all checked exceptions were wrapped with `RuntimeException`
But it was forgotten that there is a `rethrow` utility, which doesn't
wrap exception but makes the javac happy at the same time
Originally it was an application-level component, which caused non-trivial
logic and cognitive load to carefully handle those extensions to avoid
memory leaks.
6740a596 introduced a way to easily register `DiagnosticSuppressor` to
project, and this commit continues this work, making it a proper
project-level extension
A lot of changes caused by the fact, that this extension is needed to be
obtained from `BindingContext` (see `BindingContextSuppressCache` and
its usages), so almost all changes are introducing `Project` to
`BindingContext`
^KT-66449 Fixed
Create dependency provider able to resolve code from .knm metadata
files to simplify migration from the legacy kotlin-stdlib-common
artifact.
KTIJ-28668
KTI-1457
This is needed to reduce the size of generated test files, which started
to exceed default IDE limit
Also update some (mostly old) test utilities to remove exceptions from
java signatures
Duplicated messages in testdata appeared because default renderer
renders diagnostic spans ambiguously. It shows only start position.
In fact, there are 3 failures, 2 of them distinguish only by the
diagnostic end offset. See youtrack for more information.
The issue about inconvenient rendering is KT-64989.
#KT-64608
Pass the metadata serializer instance instead. This allows to further
reduce code duplication by introducing the common interface
`KlibSingleFileMetadataSerializer` for abstracting away K1 and K2
representation of a source file, as well as reusing
`Fir2KlibMetadataSerializer` across different backends.
KT-64392
- Shared application environments can be disposed in the middle of test
plan execution when the project count reaches zero. So resetting
`ApplicationManager` only on "test plan execution finished" is
incorrect, because it does not account for that scenario. Instead, we
should reset `ApplicationManager` every time the application
environment is disposed.
- We should also keep the manual reset in `testPlanExecutionFinished`
because `disposeApplicationEnvironment` may not need to dispose
anything if there isn't a shared application environment, but we
should still reset `ApplicationManager` if an unshared application
environment was created.
- This fixes "Some test disposed, but forgot to clear MockApplication"
exceptions which appeared after KT-64099 because it opened up proper
disposal of the shared application environment (instead of it being in
a state of leakage because not all project disposables were properly
disposed).
^KT-63650
^KT-64099
Now, we detect clashing signatures during serialization to KLIB and
report a compiler error if two or more declarations have the same
`IdSignature`
For example, for the following code:
```kotlin
@Deprecated("", level = DeprecationLevel.HIDDEN)
fun foo(): String = ""
fun foo(): Int = 0
```
the compiler will produce this diagnostic:
```
e: main.kt:1:1 Platform declaration clash: The following declarations
have the same KLIB signature (/foo|foo(){}[0]):
fun foo(): String defined in root package
fun foo(): Int defined in root package
e: main.kt:4:1 Platform declaration clash: The following declarations
have the same KLIB signature (/foo|foo(){}[0]):
fun foo(): String defined in root package
fun foo(): Int defined in root package
```
Note that we report this diagnostic during serialization and not earlier
(e.g., in fir2ir) for more robustness, so ensure that we check
exactly the signatures that will be written to a KLIB.
If we later introduce some annotation for customizing a declaration's
signature (e.g., for preserving binary compatibility), this
diagnostic will continue to work as expected.
^KT-63670 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
- This helps to track down disposables which are never disposed, and
reduces confusion when printing disposables in general (the names will
now be meaningful, instead of endless lists of "newDisposable" and
"TestDisposable").
^KT-64099
The change 9de6df6104 caused tests `requireKotlinCompilerVersion{,K2}`
to fail once the compiler version was changed to 2.0.0-dev-*. The reason
is that when patch version is 0, compiler version is equal to the
language version (which is itself always equal to JvmMetadataVersion).
So if we're replacing JvmMetadataVersion first, we end up with
`$ABI_VERSION$-dev-...` in the output, which is incorrect.
This commit is a slightly modified revert of 4f29c113.
IS_PRE_RELEASE allows to make LATEST_STABLE version behave as
experimental when this flag is set to true.
The general goal is to prepare fix of KT-62058; after this commit
one can do it by changing IS_PRE_RELEASE flag to true.
The fix of KT-62058 is planned to be done during bootstrapping.
This preparation and the future fix are parts of umbrella KT-61951.