Commit Graph

744 Commits

Author SHA1 Message Date
Jinseong Jeon 5880d80d26 FIR LC: add support for inline class 2021-11-01 19:17:26 +01:00
Jinseong Jeon 95a3e81098 LC: remove unnecessary referential equality check and semicolon in inline class 2021-11-01 19:17:25 +01:00
Stanislav Erokhin 65abc94411 [ULC] Unify modifiers for RepeatableAnnotationContainer
All the other annotation classes has abstract modifier.
All nested interfaces has static modifiers.

This commit is not so important for compiler, but it is matter for IDE,
because when we load classes in IDE via
KtLightClassForDecompiledDeclaration -- there are Abstract and Static
on the Container class
2021-11-01 10:38:08 +00:00
Jinseong Jeon 71e7cfb036 LC: use JvmAbi.DELEGATED_PROPERTY_NAME_SUFFIX 2021-10-27 17:06:31 +02:00
Ilya Kirillov e95313acbb ULC: do not use synchronized lazy as safe publication lazy is enough for LC 2021-10-01 16:48:35 +02:00
Ilya Kirillov f90fc8a46e ULC: do not break laziness contract when computing declaration qualified name
^KTIJ-19780 fixed
2021-10-01 16:48:35 +02:00
Jinseong Jeon aad02c1259 FIR LC: introduce modifier list for members
to simulate `default` modifier of methods in interface
2021-09-29 22:02:48 +02:00
Victor Petukhov a264cbfe7d Move CallUtil.kt under the resolve.util package 2021-09-27 16:12:01 +03:00
Vyacheslav Gerasimov ab146bd6d4 Build: Fix deprecated Gradle configurations usages
for migration to Gradle 7+ #KTI-559
2021-09-26 18:28:44 +03:00
Jinseong Jeon fe41c4513f LC: weaken condition to lookup nested annotation
FIR LC has a different abstraction, so using the specific class name is
literally too specific to FE 1.0 LC.

We could introduce a common interface for those, but checking
`kotlinOrigin` is good enough, and thus type-checking their common
ancestor is good enough too.
2021-09-23 00:11:25 +02:00
Dmitry Gridin 5d56bd545e [light classes] methods: fix PluginException: Incorrect CachedValue use
^KTIJ-6085 Fixed
2021-09-21 02:42:41 +00:00
Dmitry Gridin 9ceb477523 [light classes] fix cache value creation
Cause: we are implicitly wrapping `jvmDefaultMode` that leads to
incorrect result

^KTIJ-19042 Fixed
^EA-357501 Fixed
2021-09-17 03:49:38 +00:00
Dmitry Gridin 72752473bf [light classes] KtLightClassForSourceDeclaration: update equals and hashCode to fix PluginException
^KTIJ-19042 Fixed
^EA-357501 Fixed
2021-09-13 11:43:22 +00:00
Ivan Kochurkin 2baed77598 [FIR] Add JVM_SYNTHETIC_ON_DELEGATE diagnostic
Extract JVM names to common JvmNames
2021-09-10 00:49:03 +03:00
Ivan Kochurkin e3805c9b98 Extract JvmNames, JvmFieldApplicabilityProblem to compiler.common 2021-09-10 00:49:01 +03:00
Jinseong Jeon 6342e6ecad FIR/LC: fix modality of enum class
enum class, which is extended by enum entries, should not be final.
(Those enum entries should be, instead.)

enum class itself wouldn't be instantiated, and thus it's technically
abstract, but having a private ctor() would be an option.
For the latter case, we can simply put no modality modifier.
2021-09-09 16:07:09 +02:00
Jinseong Jeon 204c5952bf LC: avoid adding @null nullability annotations 2021-09-09 16:07:09 +02:00
Jinseong Jeon 9e7ee2fdea Unify and use default value parameter name in default setter 2021-09-09 16:07:09 +02:00
Dmitry Gridin 9095774600 lightClassUtils: cleanup code 2021-09-09 11:17:36 +00:00
Dmitry Gridin 542d109166 JavaElementFinder: cleanup code 2021-09-09 11:17:36 +00:00
Dmitry Gridin 862e87b1ba JavaElementFinder: support repeatable annotation container
^KTIJ-19318
2021-09-09 11:17:35 +00:00
Dmitry Gridin 8b5d6827c9 [ULC] fix compatibility with java analyzer for repeatable annotation
* imitate `getReferenceName` to provide interop with existed java analyzer [AnnotationsHighlightUtil.java:238](https://github.com/JetBrains/intellij-community/blob/ad7c664356b2f21af1fa204d5b7b014d8af10fd3/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/AnnotationsHighlightUtil.java#L238)

^KTIJ-19318
2021-09-07 12:47:25 +00:00
Dmitry Gridin 11e71e4e27 [ULC] support repeatable annotation and container
^KTIJ-19318
2021-09-07 12:47:24 +00:00
Ilmir Usmanov 1f8dd45c2b Remove experimental coroutines support. Part 2 2021-08-30 14:21:57 +03:00
Ilmir Usmanov 486c6b3c15 Remove obsolete experimental coroutines support
in compiler.
2021-08-13 22:31:30 +02:00
Igor Yakovlev b64f7909b8 [FIR IDE] Implement own fir light classes support 2021-07-07 14:08:41 +02:00
Roman Golyshev 7b1052296e Do not try to create a light class for classes in unexpected positions
Example of such class declaration would be `10 < class A` expression

The expression is uncompilable, but parsable. Unfortunately, the
FIR compiler does not save `class A` reference in it (because it
is not an expression, and only an expression can be a LHS or RHS of
binary expression `10 < ...`)

When we try to build light classes, we will try to find/build FIR
declaration for this class, but we won't be able to, and this will throw
an error

Adding this check should fix few
`FirKotlinHighlightingPassTestGenerated$Regression` tests
2021-07-02 04:07:26 +03:00
Igor Yakovlev b0df70dbfe [ULC] Fix delegate field type resolve
Fixed #KT-46519
2021-05-19 20:49:55 +03:00
Jinseong Jeon 225e3a747c LC: introduce light class interface for facade
so that FIR-based light class for facade can work well in LC utils
2021-05-05 14:11:48 +02:00
Jinseong Jeon efba90c6f1 LC: rename KtLightClassForFacade to ...Impl
before introducing a common interface for light class for facade

This is a mechanical refactoring.
2021-05-05 14:11:48 +02:00
Nikolay Krasko 66683d2952 Unwrap both parts of light element in KtLightElementBase.isEquivalentTo
Even if origins are same, wrapped light elements are not equivalent.

Revealed by running bunch of JavaAgainstKotlinBinariesCheckerTestGenerated
tests.

com.intellij.testFramework.LoggedErrorProcessor$TestLoggerAssertionError: Non-idempotent computation:
it returns different results when invoked multiple times or on different threads:

  KtLightMethodForDecompiledDeclaration of KtLightClassForDecompiledDeclaration of PsiFile:A.class != KtLightMethodForDecompiledDeclaration of KtLightClassForDecompiledDeclaration of PsiFile:A.class
2021-04-29 18:20:38 +03:00
Igor Yakovlev e4870740e1 [LC] Fixed light classes nullability for Kotlin 1.5
Fixed #KT-44472
2021-04-20 15:21:12 +02:00
Igor Yakovlev 63160293fb [LC] Fix invalid nullability for properties
Fixed #KT-46097 and #KT-41671
2021-04-20 15:21:12 +02:00
Matthew Gharrity 5ce746f1ec ULC field has null nameIdentifier
KtUltraLightFieldForSourceDeclaration implements PsiField, for which
getNameIdentifier() is marked @NonNull, so some clients expect a
non-null return value.

#KT-45629 Fixed
2021-04-12 21:41:54 +03:00
Vyacheslav Gerasimov f2a892a972 Cleanup 201 and as41 bunch files 2021-03-30 14:23:43 +03:00
Vladimir Dolzhenko 88058ca2c8 Fix non-default constructors for service and extension class violation 2021-03-25 12:57:07 +01:00
Mikhail Zarechenskiy 111e54c8c1 Do not generate DefaultImpls for light classes if not needed
#KT-41130 In Progress
2021-03-18 16:38:52 +03:00
Igor Yakovlev 023b7fbb8f [ULC] Fix invalid primitive type annotating
Fixed #KT-45417
2021-03-12 10:35:37 +01:00
Igor Yakovlev b744f41c0d [ULC] Fix annotations invalid parents
Fixed #KT-45287
2021-03-05 14:33:10 +01:00
Igor Yakovlev 179cf303da [ULC] Fix annotations with no site for ctor
Fixed #KT-45291
2021-03-05 14:33:10 +01:00
Mikhael Bogdanov 373d0ac660 Fix ultra light class generation for private suspend methods 2021-03-01 16:20:20 +01:00
Igor Yakovlev 5d4606daaa [FIR IDE] Remove LightClassProvider 2021-02-01 21:21:02 +03:00
Alexander Udalov adfa8c788c Light classes: use JVM target from the module
Using "JVM_1_8" always resulted in incorrect mapping of Kotlin
annotation targets to Java element types.

The change in AbstractKotlinRenderLogTest is needed because while
CliTraceHolder.module is technically a descriptor leak, it was never
detected by this test accidentally, because of the depth cutoff equal to
10, which started to not be enough after the minor refactoring of
replacing `Delegates.notNull` with `lateinit`.
2021-02-01 11:54:05 +01:00
Alexander Udalov 64e97225b8 Light classes: map annotation targets depending on JVM target
Since the default JVM target (`JvmTarget.DEFAULT`) is now 1.8, the
changed test started to fail. This change fixes it.
2021-02-01 11:54:04 +01:00
Vladimir Dolzhenko 6331a135c8 Add LightClassUtil.getLightClassMethodsByName to avoid resolving all lightClassMethods and filtration later on 2021-01-18 11:13:16 +00:00
Alexander Udalov b3d85e656e Fix warnings after update to 202 platform
#KT-44069 Fixed
2021-01-13 19:17:22 +01:00
Denis.Zharkov 0e3aaceb16 Fix ultra light structure for @JvmRecord classes 2021-01-11 20:51:40 +03:00
Igor Yakovlev 2fa5ab6e31 [FIR IDE] LC Remove difficult caching from FirLightClassBase 2020-12-16 12:29:54 +03:00
Igor Yakovlev 010a290132 [LC] Fix for light classes equivalence 2020-12-15 01:51:23 +03:00
Igor Yakovlev 45112a3c11 [ULC] Fix invalid positive inheritor for self checking
Fixed #KT-43824
2020-12-14 20:34:42 +03:00