IrMangledNameAndSignatureDumpHandler can dump either signature mangled
names by Fir or by descriptors, but not both at the same time. And
mangled names should be equal to preserve ABI compatibility.
^KT-57788
- For each test, `ReplCompilerJava8Test` effectively created two
environments: one in `setUp` for pre-compilation and one in `runTest`
managed by `GenericReplCompiler`. The `setUp` environment is unshared,
so it wasn't the same as the one managed by `GenericReplCompiler`.
Because the `setUp` environment was registered with
`testRootDisposable`, its application and project were effectively
disposed at the end of the test, together with the other environment.
- Adding a call to `resetApplicationManager` to
`KotlinCoreEnvironment.disposeApplicationEnvironment` in a previous
commit caused `ReplCompilerJava8Test` to fail with the following
sequence:
1. At the end of a test, `testRootDisposable` is disposed.
2. The project count disposable registered in
`getOrCreateApplicationEnvironment` is disposed first. This causes
the shared application's project count to go to 0 and triggers its
disposal via `disposeApplicationEnvironment`.
3. In `disposeApplicationEnvironment`, the application manager's
application is reset to `null`.
4. The disposer continues with disposables which were registered for
the `setUp` environment initially. One of these is
`PsiManagerImpl`, which disposes `FileManagerImpl`, during whose
disposal `ApplicationManager.getApplication()` is called. Since the
application was reset, it is now `null` and an NPE occurs.
- The solution disposes the `setUp` environment early so that it cannot
clash with the shared environment from `GenericReplCompiler`.
^KT-64099
- The incremental configuration for JS recompilation tests creates its
own test root disposable. It needs to be properly handled to avoid
disposable leaks.
- The incremental configuration's disposable is registered with the
parent configuration's disposable because it lives in its scope and
should thus not be a root disposable. It's also disposed at the end of
`transform` because the incremental configuration's lifetime ends
there.
^KT-64099 fixed
- `testDisposable` is already managed by `KtUsefulTestCase`, so disposal
support comes for free. This replaces the previous `TestDisposable`,
which was never disposed properly.
^KT-64099