Commit Graph

1237 Commits

Author SHA1 Message Date
Dmitry Gridin acfbe30f7c [lc] drop redundant PsiManager argument from KtLightClassForFacadeBase
^KT-53543
2022-08-29 11:51:40 +00:00
Simon Ogorodnik 8f51c51eee FIR. Fix smart-cast expression unwrapping in plus with assign resolve 2022-08-26 14:57:06 +00:00
Ilya Gorbunov 6aff3c6d07 Update misc test data after introducing rangeUntil member #KT-52933 2022-08-24 22:22:54 +00:00
Nikita Bobko 2a4f3f41aa 2/5 Replace source dependency on kotlin-reflect with binary dependency
Review: https://jetbrains.team/p/kt/reviews/6753

Meaningful semantic change was splitted into 5 commits to simplify the
change review. Sinle commit would be too big.

Why replace source to binary: to get rid of kotlin-reflect in Kotlin
plugin artifact KTIJ-22276

Note: Kotlin Maven artifacts (./gradlew publish) changed their
dependency on kotlin-reflect
2022-08-22 15:43:49 +02:00
Nikita Bobko 0874fb71c6 Replace all kotlin-reflect-api dependencies with kotlin-reflect
Review: https://jetbrains.team/p/kt/reviews/6753

Why: I'm going to replace source dependency on kotlin-reflect with
binary dependency. Normalize reflect dependency before global
processing.
2022-08-22 15:43:11 +02:00
Nikita Bobko 8f79e833a8 Drop all redundant kotlin-reflect, kotlin-reflect-api dependencies
Review: https://jetbrains.team/p/kt/reviews/6753

All redundant I managed to find, of course.

Why: I'm going to process all reflect dependencies in the next commits.
Cleanup reflect dependency before processing.

They are redundant because:
1. if `compileOnly` then compilation didn't break after dropping the
   dependency
2. if `test*` then tests didn't break after dropping the dependency.
3. `analysis/analysis-api-fir/analysis-api-fir-generator/build.gradle.kts`
   `compiler/fir/checkers/checkers-component-generator/build.gradle.kts`
   Drop `implementation(project(":kotlin-reflect-api"))` because the
   module already depends on
   `implementation(project(":kotlin-reflect"))`
4. `compiler/daemon/daemon-client/build.gradle.kts`. Drop `runtimeOnly`
   because after dropping `compileOnly` compilation didn't break (so
   `runtimeOnly` looks suspicious). Less safe than 1-3
2022-08-22 15:42:57 +02:00
Nikita Bobko 70ed76e0bd Drop unused ':dist' dependency in some tests
Review: https://jetbrains.team/p/kt/reviews/6753

This commit doesn't fix any issue except for "cleanup". If you find a
mistake in this commit feel free to revert part of it/the whole commit

I checked every module where I drop ':dist' dependency. Tests still pass
in those modules
2022-08-22 15:42:34 +02:00
Jinseong Jeon 79686ba242 AA FE1.0: don't return psi for fake overrides 2022-08-20 00:50:10 +02:00
Jinseong Jeon 25f7554a31 AA FIR: constant evaluation for Java field 2022-08-20 00:50:09 +02:00
Mikhail Glukhikh a6b90fcb8e Add a test with false positive "inferred into empty intersection"
Related to KT-50232
2022-08-19 14:01:37 +00:00
Mikhail Glukhikh 730de8fd7c K1/K2: add test for enum class with 'entries' entry 2022-08-19 10:08:09 +00:00
Dmitriy Novozhilov bb38690273 [FIR] Introduce FirAssignExpressionAltererExtension
This extension can be used to override resolution of assign statements
  with custom statement
2022-08-19 07:44:09 +00:00
Arseniy Terekhov 25fc948d95 [FIR] DeprecationsProvider: make evaluation of deprecations on demand 2022-08-19 07:37:54 +00:00
Ilya Kirillov 7441388f9d [Decompiled LC] restore missed ^IDEA-286315 fix during Decompiled LC migration to the kotlin repo
^IDEA-297478 fixed
2022-08-18 16:10:51 +00:00
Jinseong Jeon 9e35815ae3 AA: fail-safe path retrieval of source files
Also, apply file extension-based filtering since javaSourceRoots is
supposed to refer to either KotlinSourceRoot or JavaSourceRoot.
2022-08-17 21:32:29 +02:00
Ilya Kirillov e489c9b549 [analysis] regenerate tests 2022-08-17 19:16:18 +02:00
Jinseong Jeon 1b79ee89ba AA: drop ProjectStructureProvider#getKtBinaryModules
Instead, provide an option to register PSI declaration provider inside
Analysis API session builder where we can retrieve all necessary pieces,
including CoreJarFileSystem, PackagePartProvider, and binary modules
from internal project structure provider.
2022-08-17 19:16:18 +02:00
Jinseong Jeon 2a864b3685 AA: add tests for PsiDeclarationAndKtSymbolEqualityChecker 2022-08-17 19:16:17 +02:00
Jinseong Jeon 846ab7d97b AA: revamp standalone-mode tests 2022-08-17 19:16:17 +02:00
Jinseong Jeon ed92cc43c7 AA: introduce eq checker to handle ambiguous PSI from binary module 2022-08-17 13:35:29 +02:00
Iven Krall ec8da2033c KT-8263: Conditional operators are not parsed correctly 2022-08-16 10:00:54 +00:00
Iven Krall 2053363def KT-35811: Type parameter angle brackets followed by equal sign are parsed incorrectly if whitespace is missing 2022-08-16 10:00:53 +00:00
Simon Ogorodnik 6dd9115ee9 FE1.0 Analysis API: Fix kind in implicit smart-casts info 2022-08-15 21:46:11 +00:00
Simon Ogorodnik 513af2dfbc FIR. Refactor smart-cast representation in FIR tree
Make smart-casts non-transparent expression without delegation
to underlying FirQualifiedAccessExpression, as children delegation in
fir tree has unclear semantics
Remove two different kinds of tree nodes for smart-casts
2022-08-15 21:46:11 +00:00
Kristoffer Andersen bc9db58b3c [AA] Rename getElementOfTyp_e_AtCaret 2022-08-15 23:32:33 +02:00
Dmitry Gridin c9e9ee90a3 [analysis] remove redundant OptIn annotations 2022-08-15 11:04:59 +02:00
Dmitry Gridin 8dbdea39da [analysis] remove redundant diagnostic suppression 2022-08-15 11:04:58 +02:00
Dmitry Gridin 6a83bcf349 [lc] reformat KotlinAsJavaSupport
^KT-53543
2022-08-15 11:04:31 +02:00
Vsevolod Tolstopyatov 22e26d0756 Move EnumEntries LVS to 1.9
* Also cleanup tests to avoid using obsolete WITH_RUNTIME
2022-08-12 09:35:32 +00:00
Mikhail Glukhikh 10ffdab438 Analysis API FIR: fix isDefaultEnumEntryMember 2022-08-12 09:35:31 +00:00
Mikhail Glukhikh 41b73abc49 Analysis API FIR: fix exception in LC support for Enum.entries property 2022-08-12 09:35:30 +00:00
Mikhail Glukhikh 7333589663 K1/K2: add Enum.entries unconditionally and filter them out in tower
Before this commit, we added Enum.entries only in case when
LanguageFeature.EnumEntries was ON (with an exception in K1/Java case).
In this commit we add Enum.entries unconditionally, and in case
the language feature is OFF we filter them out during tower resolve.
2022-08-12 09:35:27 +00:00
Mikhail Glukhikh 81e1131441 SubclassOptInRequired: add extra test about inheritance and superseding 2022-08-11 14:05:09 +00:00
Mikhail Glukhikh 80a9f22052 Add applicability checks & tests for SubclassOptInRequired 2022-08-11 14:05:09 +00:00
Mikhail Glukhikh c67c5cad27 K1: report errors related to SubClassOptInRequired annotation
Related to KT-41886
2022-08-11 14:05:07 +00:00
Pavel Mikhailovskii 8ba80b4b7b KT-1436 Allow break/continue in inlined lambdas 2022-08-11 10:38:23 +00:00
Ilya Kirillov 1c28eef82a [LL FIR] rename FirLazyDeclarationResolver -> LLFirModuleLazyDeclarationResolver
to avoid naming collisions with LLFirLazyDeclarationResolver
2022-08-10 22:49:19 +02:00
Ilya Kirillov 0748f28efe [FIR] rename ensureResolve -> lazyResolveToPhase as it better describes function semantics 2022-08-10 22:49:18 +02:00
Ilya Kirillov e7e9c24473 [LL FIR] update lazy resolve testdata after changes in phases 2022-08-10 22:49:18 +02:00
Ilya Kirillov 230c21f502 [LL FIR] fix not-resolved getter return type in on-air resolve 2022-08-10 22:49:18 +02:00
Ilya Kirillov 9f1ecdfaa1 [LL FIR] add lazy resolve check to ensure that all nested declarations are resolved
This bow includes: value parameters, property accessors and class members;
before, only class members was checked
2022-08-10 22:49:17 +02:00
Ilya Kirillov 75787be2f8 [Analysis] change null element rendering in exceptions to distinguish will "null" strings 2022-08-10 22:49:17 +02:00
Ilya Kirillov 107a8e4d92 [FIR] create error type ref for parameter when one is required instead of implicit type in RawFirBuilder
Needed to avoid failure during lazy resolving of corresponding declarations in the IDE

^KTIJ-22357 fixed
2022-08-10 22:49:16 +02:00
Ilya Kirillov b27115c793 [LL FIR] rename ensurePhase -> checkPhase to distinguish with ensureResolved 2022-08-10 22:49:15 +02:00
Ilya Kirillov 88c68be12d [Analysis API FIR] add additional information to exceptions from call resolution 2022-08-10 22:49:15 +02:00
Ilya Kirillov f45f1ba3dc [Analysis API] do not create multiple attachments inside exceptions 2022-08-10 22:49:14 +02:00
Ilya Kirillov 72da40f97c [LL FIR] update phase of type parameters on lazy resolve 2022-08-10 22:49:14 +02:00
Ilya Kirillov 0f6f901179 [LL FIR] render type parameters resolve phase in tests 2022-08-10 22:49:13 +02:00
Ilya Kirillov cd063d0cd0 [LL FIR] update phase of value parameters on lazy resolve
Previously, such phases may not be properly set which could cause additional lazy resolve
2022-08-10 22:49:13 +02:00
Ilya Kirillov 56e6d5d6b9 [Analysis API] do not preresolve all FirDeclarations to TYPES in tests
Previously, we resolved all declaration to the TYPES phase to collect their sealed inheritors
and thus not really checking lazy resolution to TYPES.
Now sealed class inheritors collection happens in separate LLFirResolveSession
2022-08-10 22:49:13 +02:00