Default SimpleTypeMarker::withNullability from ConeTypeContext
doesn't take into account inference-related type kinds like type variables
These cases are properly handled in
org.jetbrains.kotlin.fir.resolve.ResolveUtilsKt#withNullability
Original exception trace:
at org.jetbrains.kotlin.fir.types.ConeTypeContext$DefaultImpls.withNullability(ConeTypeContext.kt:142)
at org.jetbrains.kotlin.fir.resolve.calls.ConeInferenceContext$DefaultImpls.withNullability(ConeInferenceContext.kt)
at org.jetbrains.kotlin.fir.resolve.transformers.FirBodyResolveTransformerKt$inferenceComponents$1.withNullability(FirBodyResolveTransformer.kt:943)
at org.jetbrains.kotlin.fir.resolve.calls.ConeInferenceContext$DefaultImpls.makeSimpleTypeDefinitelyNotNullOrNotNull(ConeInferenceContext.kt:195)
at org.jetbrains.kotlin.fir.resolve.transformers.FirBodyResolveTransformerKt$inferenceComponents$1.makeSimpleTypeDefinitelyNotNullOrNotNull(FirBodyResolveTransformer.kt:943)
at org.jetbrains.kotlin.resolve.calls.inference.model.NewConstraintSystemImpl.makeSimpleTypeDefinitelyNotNullOrNotNull(NewConstraintSystemImpl.kt)
at org.jetbrains.kotlin.resolve.calls.inference.components.ConstraintInjector$TypeCheckerContext.makeSimpleTypeDefinitelyNotNullOrNotNull(ConstraintInjector.kt)
at org.jetbrains.kotlin.resolve.calls.inference.components.AbstractTypeCheckerContextForConstraintSystem.simplifyLowerConstraint(AbstractTypeCheckerContextForConstraintSystem.kt:163)
at org.jetbrains.kotlin.resolve.calls.inference.components.AbstractTypeCheckerContextForConstraintSystem.internalAddSubtypeConstraint(AbstractTypeCheckerContextForConstraintSystem.kt:71)
at org.jetbrains.kotlin.resolve.calls.inference.components.AbstractTypeCheckerContextForConstraintSystem.addSubtypeConstraint(AbstractTypeCheckerContextForConstraintSystem.kt:50)
at org.jetbrains.kotlin.types.AbstractTypeChecker.completeIsSubTypeOf(AbstractTypeChecker.kt:193)
at org.jetbrains.kotlin.types.AbstractTypeChecker.isSubtypeOf(AbstractTypeChecker.kt:164)
at org.jetbrains.kotlin.resolve.calls.inference.components.ConstraintInjector$TypeCheckerContext.runIsSubtypeOf(ConstraintInjector.kt:153)
at org.jetbrains.kotlin.resolve.calls.inference.components.ConstraintInjector.addSubTypeConstraintAndIncorporateIt(ConstraintInjector.kt:77)
at org.jetbrains.kotlin.resolve.calls.inference.components.ConstraintInjector.addInitialSubtypeConstraint(ConstraintInjector.kt:55)
at org.jetbrains.kotlin.resolve.calls.inference.model.NewConstraintSystemImpl.addSubtypeConstraint(NewConstraintSystemImpl.kt:84)
at org.jetbrains.kotlin.resolve.calls.inference.ConstraintSystemBuilderKt$addSubtypeConstraintIfCompatible$1.invoke(ConstraintSystemBuilder.kt:61)
at org.jetbrains.kotlin.resolve.calls.inference.ConstraintSystemBuilderKt$addSubtypeConstraintIfCompatible$1.invoke(ConstraintSystemBuilder.kt)
at org.jetbrains.kotlin.resolve.calls.inference.model.NewConstraintSystemImpl.runTransaction(NewConstraintSystemImpl.kt:130)
at org.jetbrains.kotlin.resolve.calls.inference.ConstraintSystemBuilderKt.addSubtypeConstraintIfCompatible(ConstraintSystemBuilder.kt:60)
at org.jetbrains.kotlin.fir.resolve.calls.ArgumentsKt.checkApplicabilityForArgumentType(Arguments.kt:170)
at org.jetbrains.kotlin.fir.resolve.calls.ArgumentsKt.resolvePlainArgumentType(Arguments.kt:158)
at org.jetbrains.kotlin.fir.resolve.calls.ArgumentsKt.resolveSubCallArgument(Arguments.kt:123)
at org.jetbrains.kotlin.fir.resolve.calls.ArgumentsKt.resolveArgumentExpression(Arguments.kt:42)
at org.jetbrains.kotlin.fir.resolve.calls.ArgumentsKt.resolveArgument(Arguments.kt:196)
at org.jetbrains.kotlin.fir.resolve.calls.CheckArguments.check(ResolverParts.kt:145)
at org.jetbrains.kotlin.fir.resolve.calls.CheckArguments$check$1.invokeSuspend(ResolverParts.kt)
In particular, we should not cache classes or instances for property
references, since they may be used inside of inline funtions. This also
allows us to mark the $$delegatedProperties array as package private.
- this adds enum entries to the completion on the typealiases
- we cannot use `unsubstitutedInnerClassesScope` instead of `EnumEntriesScope` because it allows to complete things that are not allowed to be resolved by the Kotlin compiler; see `EnumEntriesScope` doc for details
- ^KT-17689 Fixed
It is very slow in completion for build.gradle.kts because it creates SAM adapters for constructors of all imported classes
Note that those SamAdapters weren't shown in completion in any case because they were filtered by name filter (SamAdapters for constructors have <init> name)
Introduce file attributes cache, which is only applicable when no dependencies are cached in memory cache
Refactor ScriptDependenciesCache to memory cache that is able to get configuration from cache and checks if it is up to date
Move all public methods to ScriptDependenciesManager
Introduce ScriptClassRootsManager that checks if root change event should be called after script configuration update
There were several places where we converted virtualFile to PsiFile. This operation need a read access and may throw ProcessCanceledException,
so we want to minimize its usages in IDE
When testing for the JAVA_HOME environment variable, expand potential
symlinks first. This is almost guaranteed to be the case on all modern
Linux distributions putting the JDK / JRE behind update-alternatives to
be able to select the *current* version [0], e.g. on Fedora:
$ ls -l $JAVA_HOME
lrwxrwxrwx. ... /usr/lib/jvm/java -> /etc/alternatives/java_sdk
[0] https://linux.die.net/man/8/update-alternatives