Commit Graph

764 Commits

Author SHA1 Message Date
Nicolay Mitropolsky ccb6331e10 LC: better facade detection to fix KTIJ-21223
Merge-request: KT-MR-6130
Merged-by: Nicolay Mitropolsky <nicolay.mitropolsky@jetbrains.com>
2022-04-21 10:52:29 +00:00
Jinseong Jeon 6a9ed82fdc FIR/LC: restructure light identifiers
* introduced KtLightIdentifierBase so that both FIR LC and ULC share
  basic implementations

* detach PsiCompiledElement as per KTIJ-21412,
  while introducing KtLightIdentifierWithOrigin so that
  UastLightIdentifier can still inherit origin computation logic

^KTIJ-21412 In Progress
2022-04-13 13:43:21 +02:00
Jinseong Jeon ef94582059 LC: use lazyPub to initialize identifier of parameter 2022-04-13 13:43:19 +02:00
Jinseong Jeon e72dc7d0c9 ULC: use special name for default setter parameter
to match the name appeared at LVT in compiler-generated JVM bytecode
2022-04-12 22:05:24 +02:00
Ilya Chernikov 2044754628 Backend: remove psi files from generation state
pass them explicitly to all destinations. This is a step in attempt to
abstract dependencies on PSI in the GenerationState and related places.
2022-03-30 08:33:59 +00:00
Yan Zhulanow c334a44e02 Preserve synthetic enum methods in stub-based 'ClsClassImpl'
'ClsClassImpl' instances created by the platform contain synthetic
enum methods (added by 'ClassInnerStuffCache.calcMethods()'). Such
convention is common in IntelliJ (see KT-36095 and
'9a8b345adaded83fe13980a28db5d9f9acc7450d' in the IntelliJ repository).

This commit makes Kotlin's stub-based classes consistent with the
convention. Instead, a filter is added in place of 'ClsClassImpl' usage.

See also the following commits:
- 7c86911f44
- 43468c6d55
2022-03-14 17:53:55 +09:00
Yan Zhulanow fa4dadf9b7 Update KotlinClassInnerStuffCache implementation
'KotlinClassInnerStuffCache' was copy-pasted from the platform's
'ClassInnerStuffCache' several years ago. After J2K and other changes,
it became quite dirty.

Besides cleaning things up, enum synthetic method handling have
significantly improved. Before, such methods were handled only in
'processDeclarationsInEnum', and 'getMethods()' didn't return them.
This led to inconsistent behavior and was reason for providing special
ad-hoc support in '1b6ded600518176b21cc308ed3e032ef8d04cc90'.
2022-03-14 17:53:55 +09:00
Yan Zhulanow 955d0841bd Remove unused modification tracker in KotlinClassInnerStuffCache
'dropCaches()' is not used anywhere both in the compiler and in the IDE.
2022-03-14 17:53:55 +09:00
Yan Zhulanow f237631f05 Revert "FIR/LC: create synthetic members of enum class"
This reverts commit 1b6ded60
2022-03-14 17:53:55 +09:00
Jinseong Jeon 1b6ded6005 FIR/LC: create synthetic members of enum class
^KTIJ-17414 In Progress
^KTIJ-17444 In Progress
2022-02-24 17:51:50 +01:00
Dmitry Gridin 261cac7514 [light classes] avoid resolve in equals
^KTIJ-21209
2022-02-23 11:13:44 +07:00
Dmitry Gridin dc210fa6ef [light classes] KtUltraLightParameterForSetterParameter: simplify equals
^KTIJ-21151
2022-02-18 17:41:05 +07:00
Dmitry Gridin 30b7c4689b [light classes] KtUltraLightParameterForDescriptor: fix descriptor leak
^KTIJ-21151
2022-02-18 17:41:05 +07:00
Dmitry Gridin 47f0a84c7a [light classes] fix equals for parameters
UltraLightClassLoadingTestGenerated.testConstructors
SafeDeleteTestGenerated$KotlinValueParameterWithJava

^KTIJ-21151
2022-02-18 16:29:24 +07:00
Dmitry Gridin 85d949a04a [light classes] simplify hashCode functions
^KTIJ-21151
2022-02-17 10:31:48 +00:00
vmishenev 7820b268fb KT-50111 Add a new analysis flag eagerResolveOfLightClasses 2022-01-11 17:33:47 +03:00
Vyacheslav Gerasimov f7a9065b75 Build: Use intellij maven repo instead of downloaded IDEA
#KTI-82
2021-12-16 21:48:23 +03:00
Jinseong Jeon e36cc87b19 LC: introduce KotlinLightTypeParameterBuilder (w/ origin) 2021-12-15 10:41:50 +03:00
Jinseong Jeon 20408dc176 LC: use callable name as suffix of receiver parameter name 2021-12-14 21:01:50 +03:00
Ilya Kirillov 673459580c Analysis API: introduce annotation value for KClass 2021-12-02 20:09:16 +01:00
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