Commit Graph

57415 Commits

Author SHA1 Message Date
Steven Schäfer 2be4abe9a6 Refactoring: Consistently use Symbols in JvmSymbols 2019-09-06 15:11:59 +02:00
Steven Schäfer c77fa1ecd6 JVM IR: Fixes in SAM lowering 2019-09-06 15:11:59 +02:00
Denis Zharkov 829102b3e3 FIR: Fix exception in inference
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)
2019-09-06 13:45:28 +03:00
Denis Zharkov 8c52ff31b3 Add bunch for AS34: FirJavaElementFinder 2019-09-06 13:45:28 +03:00
Denis Zharkov 3f0887dc0c FIR: Do not try building light classes for invalid names 2019-09-06 13:45:28 +03:00
Denis Zharkov 106b6c901d FIR: Get rid of FirRegularClass::setCallbackOnSupertypesComputed 2019-09-06 13:45:28 +03:00
Denis Zharkov 122c229a8b FIR: Add possibility to run SupertypeResolverTransformer ad-hoc 2019-09-06 13:45:28 +03:00
Denis Zharkov d9d6c38c2b FIR: Introduce FirClassLikeDeclaration::supertypesComputationStatus 2019-09-06 13:44:32 +03:00
Denis Zharkov 6058f9d286 FIR: Avoid recursions while building Java enhancement scopes 2019-09-06 13:44:32 +03:00
Denis Zharkov 7f5c4d90fd FIR: make "collectSuperTypes" recursion-resistant 2019-09-06 13:44:32 +03:00
Denis Zharkov 1f23184db9 FIR: Get rid of code duplication in SupertypesUtils.kt 2019-09-06 13:44:32 +03:00
Denis Zharkov bf610323cf Support basic light-classes basic with FIR for CLI 2019-09-06 13:44:32 +03:00
Steven Schäfer e7410348a7 JVM IR: Fix visibility for @InlineOnly functions 2019-09-06 12:12:58 +02:00
Steven Schäfer ee45933e33 JVM IR: Create local classes in PropertyReferenceLowering
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.
2019-09-06 12:12:58 +02:00
Steven Schäfer 626f4c94f6 Handle special case visibility rules in LocalDeclarationsLowering 2019-09-06 12:12:58 +02:00
Roman Golyshev 9a938b07ba KT-17689: Fix TypeAliasQualifier to provide enum entries descriptors
- 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
2019-09-06 12:11:23 +03:00
Roman Golyshev f419d2eb30 KT-33585: Add synchronization between scratch editor and preview
- fix problem with not working shortcuts in the preview window by passing more params into view editor creation
2019-09-06 12:03:35 +03:00
Roman Golyshev d12d9d86bc KT-33585: Refactor KtsScratchFileEditorWithPreview and its output handlers
- now `PreviewOutputBlocksManager` is injected into `PreviewEditorScratchOutputHandler`, so `KtsScratchFileEditorWithPreview` can use it too
2019-09-06 11:36:37 +03:00
Nikolay Krasko edb700b898 Switch to 192 platform 2019-09-06 11:28:25 +03:00
Dmitry Gridin 650a6e5cc4 MakeOverriddenMemberOpenFix: should update actual members
#KT-32586 Fixed
2019-09-06 15:25:01 +07:00
Dmitry Gridin 58d303afcc MakeOverriddenMemberOpenFix: cleanup code 2019-09-06 15:25:01 +07:00
Natalia Selezneva 3f451d7eaf Switch off SAM adapter conversion for constructors in completion
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)
2019-09-06 10:53:16 +03:00
Natalia Selezneva f7b8c7f76e Check that project isn't disposed showing notification for scripts
EA-209612 - (Scripting, Notification) assert: ComponentManagerImpl.lambda$throwAlreadyDisposed$
2019-09-06 10:53:15 +03:00
Natalia Selezneva fb01f7be5e Rename ScriptDependenciesManager to ScriptConfigurationManager 2019-09-06 10:52:59 +03:00
Natalia Selezneva fa6b5b567b Fix org.jetbrains.kotlin.idea.script.ScriptConfigurationHighlightingTestGenerated.Highlighting.testThrowingResolver 2019-09-06 10:52:30 +03:00
Natalia Selezneva 961e8c2c74 Refactor the mechanism how script configurations are updated
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
2019-09-06 10:52:17 +03:00
Natalia Selezneva dc46f73ecf Rewrite scripting related API to PsiFile instead of VirtualFile
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
2019-09-06 10:51:26 +03:00
Sergey Rostov 5b48dcca4f ResultWithDiagnostics: remove unused equals and hashCode
They are overridden by sealed data classes
2019-09-06 09:33:33 +03:00
Mikhail Glukhikh 91f39a0ecf FIR [optimization]: eliminate some unnecessary ScopeSessions 2019-09-06 09:29:19 +03:00
Georgy Bronnikov 7ede26e8f4 IrCompileKotlinAgainstInlineKotlin tests 2019-09-06 09:19:57 +03:00
Nikolay Krasko 0807987ef7 Update 192 to release version 2019-09-05 19:39:04 +03:00
Nikolay Krasko 655e77b0dd Update lz4 for 192 in :compiler:incremental-compilation 2019-09-05 19:39:03 +03:00
Ilya Ryzhenkov 7968ecef1c Initial import of benchmarks from https://github.com/dzharkov/kotlin-compiler-benchmarks 2019-09-05 18:31:54 +03:00
Vyacheslav Gerasimov 1bd5b68b4a Build: Instrument only java tasks for main & test source sets 2019-09-05 18:31:54 +03:00
Vyacheslav Gerasimov 50eb98194a Build: Move dependencies.properties to the root build directory 2019-09-05 17:21:48 +03:00
pyos 20626e4aaf Make ReturnableBlockLowering common
and remove special handling in JVM_IR codegen.
2019-09-05 15:48:26 +02:00
Sascha Peilicke ae8c93de6a Support symlinked JAVA_HOME
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
2019-09-05 16:36:08 +03:00
Mikhail Glukhikh 98f72e58bd FIR deserializer: use class type parameters in constructor directly
This allows calls like Pair(...) to be resolved correctly
2019-09-05 16:26:15 +03:00
Mikhail Glukhikh 6a7ebe8928 FIR substitution: do not create fake overrides if types aren't changed 2019-09-05 16:26:14 +03:00
Mikhail Glukhikh 5386cfe254 FIR2IR: support fake overridden properties 2019-09-05 16:26:14 +03:00
Mikhail Glukhikh 687db20029 FIR: support fake overrides for properties 2019-09-05 16:26:14 +03:00
Mikhail Glukhikh 5741ff5d86 FIR: split default importing scopes into low/high priority ones
This fixes resolve of StringBuilder(), AssertionError(), etc.
2019-09-05 16:26:14 +03:00
Mikhail Glukhikh 044dfd14ce FIR: more accurate type checking in typeFromCallee 2019-09-05 16:26:06 +03:00
Ilya Goncharov c27ed0cfd3 Update ReadMe for gradle-plugin-integration-tests 2019-09-05 14:37:00 +03:00
Nikolay Krasko 5deaca9ace Fix building tests for fir:lightTree in 192 branch 2019-09-05 14:35:17 +03:00
Nikolay Krasko 7bdde7cad3 Disable HierarchicalMultiplatformProjectImportingTest in Android Studio (KT-33067) 2019-09-05 14:35:17 +03:00
Andrey Uskov 48d666daea Make platforms order reproducible in iml-files
#KT-33316 Fixed
2019-09-05 14:14:33 +03:00
Dmitry Gridin a843c23f20 Completion: add root prefix support
#KT-10340 Fixed
2019-09-05 18:01:23 +07:00
Dmitry Gridin 7a4c3e4d6a BaseDeclarationInsertHandler: fix startOffset 2019-09-05 18:01:23 +07:00
Dmitry Gridin c4a1101600 KtSimpleNameReference: add root prefix support to bindToFqName function 2019-09-05 18:01:23 +07:00