Investigation was started because of flaky behaviour in
NewJavaToKotlinConverterSingleFileTestGenerated tests. Approximately 1
of 3 all tests executions caused failure in one of the tests.
Analyze showed that unlike the successful run, failure test was missing
PSI event with PerModulePackageCache index invalidation.
This was caused by null from FileManagerImpl.findCachedViewProvider()
and null from FileDocumentManagerImpl.getDocumentFromCache().
Both methods use weak references maps to operate:
FileManagerImpl.myVFileToViewProviderMap and
FileDocumentManagerImpl.myDocumentCache.
#KT-35907 Fixed
It partially reverts 7898922066
because it's not obvious that it's a safe operation
for invariant/contravariant types.
Also, there's a necessary fix in prepareReceiverRegardingCaptureTypes
to make types order stable
Otherwise test bareTypesWithStarProjections becomes flaky.
Also, the changes in bareTypesWithStarProjections.kt are also expected
because the type of the expression `coneSymbol` after the second "if" is
FirVariableSymbol<*> & FirPropertySymbol & AbstractFirBasedSymbol<*>
thus we fix D in the call `coneSymbol.phasedFir()` to FirVariableSymbol<*>
because it's the first type in the list
(see the next line after the last changed in AbstractTypeChecker)
See the test and the issue for the clarification
After the change 7898922066
the expected type for "a" in expression "foo(a)" is A<E & B<*>>
But we have the original type A<E> and smart-casted enriched type A<B<*>>
(non of them is a subtype of A<E & B<*>>)
and fail in checkTypeInternal when checking types in during completion
^KT-35844 Fixed
Old version handled only private companions correctly.
Some situations require multiple companion object accessors
(including accessors for protected companion objects from supertypes)
to be generated in the corresponding class.
The JVM IR backend was producing class names with "<no name provided>"
for unnamed functions (i.e., `fun(...) {}`). This produces class files
with names invalid in Windows. This change adds validation of names
using the same set of invalid characters used in the frontend, which
should ensure class file names are valid.
Rename and refactor interface delegation phase. It didn't actually do
what was said on the box. It should be more in line with the
intentions of the phase now.
Wrapped descriptors are still used in reporting of the "conflicting JVM
signatures" diagnostic in the JVM IR backend, and TODOs in
implementations prevent that diagnostic from being shown, obscuring even
the place where the error happens.