Commit Graph

5254 Commits

Author SHA1 Message Date
Tianyu Geng 8ba2e4d221 FIR: move JavaAnnotationMapper.javaToKotlinNameMap to common
so that FIR IDE logic can reference it
2021-11-04 20:52:50 +01:00
Jinseong Jeon c3c79b874d FIR IDE: make constant evaluator robust to arithmetic exception 2021-11-01 22:50:47 +01:00
Jinseong Jeon 2dc2a90755 Introduce an API to convert TypeConstructorMarker to TypeParameterMarker 2021-10-28 12:54:45 +03:00
Sergej Jaskiewicz a367b91aa1 [IR] [Refactoring] Add toString and String::plus to IrBuiltins
Also use `OperatorNameConventions` constants instead of magic strings
2021-10-28 08:35:11 +00:00
Victor Petukhov 64c682f465 Remove constraints containing stub types after completion of the common system of a builder inference call
^KT-49285 Fixed
2021-10-26 19:37:59 +03:00
Victor Petukhov 2261928f4f Process simple CapturedType in ClassicTypeSystemContext.typeConstructorProjection as well
^KT-49101 Fixed
2021-10-26 19:37:58 +03:00
Victor Petukhov d015d3bc0e Don't enhance previously erased value parameters for jspecify strict mode
^KT-48261 Fixed
2021-10-26 19:37:55 +03:00
Denis.Zharkov 0bdea4f20a FIR: Do not create incorrect synthetic property 2021-10-26 18:45:59 +03:00
Denis.Zharkov fe1b4d61c2 Move some property convention helpers to compiler.common.jvm
Since it will be used in FIR, too
2021-10-26 18:45:58 +03:00
Tianyu Geng 6a59dc7fa5 FIR: add bfs helper and use it
It's also used in Kotlin quickfixes in intellij repo
2021-10-26 00:42:09 +02:00
Ilya Kirillov a11cd74b28 Revert "FIR: add bfs helper and use it"
This reverts commit dbb0496d23.
2021-10-26 00:37:31 +02:00
Tianyu Geng dbb0496d23 FIR: add bfs helper and use it
It's also used in Kotlin quickfixes in intellij repo
2021-10-26 00:06:00 +02:00
Tianyu Geng f23256bf49 FIR: filter out builtin symbols in JvmClassFileBasedSymbolProvider
These symbols are already provided by FirBuiltinSymbolProvider.
2021-10-23 15:33:31 +02:00
Yan Zhulanow 516dd825c2 [FIR IDE] Initial descriptor-based implementation of the Analysis API 2021-10-20 19:41:24 +03:00
Yan Zhulanow 44a1fe668e [FIR IDE] Extract implicit set parameter name to reuse it in Analysis API 2021-10-20 19:41:21 +03:00
Dmitriy Novozhilov bee44c6e0f [FIR] Split :compiler:fir:resolve module into three different modules
Those modules are:
- :compiler:fir:providers, which contains Fir and Symbol providers,
    scopes, and different utilities used by them
- :compiler:fir:semantics, which contains different abstractions and
    entities which are used in resolution and in checkers
- :compiler:fir:resolve, which contains all stuff related to resolution
    and inference

There are two pros of this change:
1. It may increase gradle build, because it allows to compile :fir:resolve
  and :fir:checkers modules in parallel
2. Logic of working FIR (scopes, providers, DFA logic system, etc) is
  now separated from logic of resolution phases, so for example checkers,
  which are depend on scopes physically will not be able to run resolve
  in any way
2021-10-18 11:10:47 +03:00
Mark Punzalan 167dc81d3b FIR/Analysis API: Get parameter name from function type notation or
`@ParameterName` annotation, which is also now added during type
resolution.
2021-10-15 16:19:00 +03:00
Dmitriy Novozhilov f3a9d70eb6 [FIR] Add ability to generate members and nested classifiers for generated classes 2021-10-12 17:26:29 +03:00
Dmitriy Novozhilov 760943f0e1 [FE] Make setter of CallableId.classId private
Fact that `classId` is `var` is detail of implementation,
  so there is no reason to expose its setter to public API
2021-10-12 17:26:24 +03:00
Vladimir Dolzhenko b2afb602c5 Add InvalidModuleNotifier capability
Relates to #KT-48977
2021-10-02 14:29:25 +02:00
Georgy Bronnikov 41e38d5a1a JVM_IR: move serialized IR to a separate annotation 2021-10-02 00:56:46 +03:00
Jinseong Jeon c8047f8384 Unify and use names of synthetic members of data class 2021-09-30 19:42:42 +02:00
Victor Petukhov 0cb56be14f Have "in type" for java fields to be able to check that type in assignment positions (against rhs' type)
^KT-46727 Fixed
2021-09-30 20:08:52 +03:00
Victor Petukhov 70d70b9042 Use warn mode by default for jspecify nullability annotations in 1.6
^KT-48851 Fixed
2021-09-30 20:08:35 +03:00
Dmitriy Novozhilov e933c7b6d9 [Build] Remove testApi(intellijDep()) dependencies from all modules
Since IDEA moved most of it's jars to java 11 it's illegal to use them
  in our dependencies, so all modules which use `intellijDep()` should
  carefully specify which jars they use
2021-09-30 14:41:31 +03:00
Denis.Zharkov 4733a0d970 Refine naming: *TypeVariable -> *TypeParameter 2021-09-30 14:36:27 +03:00
Denis.Zharkov f7ef551f99 Report warnings on overrides with wrong types nullability
^KT-48899 Fixed
2021-09-30 14:36:26 +03:00
Denis.Zharkov ec97dab6cd Simplify OverridingUtil
Do not use NewKotlinTypeCheckerImpl
2021-09-30 14:36:25 +03:00
Denis.Zharkov 9ac29e0714 Fix enhancement when mixing TYPE_USE and non-TYPE_USE annotations 2021-09-28 22:59:18 +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
Denis.Zharkov 38fa900e56 FIR: Optimize case with no annotations on package 2021-09-23 16:58:26 +03:00
Dmitry Gridin a0d36d7e29 [core] annotation loader: pull up isRepeatableWithImplicitContainer to AbstractBinaryClassAnnotationAndConstantLoader to reuse from plugin
^KTIJ-19676
2021-09-22 04:54:28 +00:00
Aleksei.Cherepanov 47a1dd27dd Fix after review KT-CR-4441 of cc5382b3
Simplify API of InlineConstTracker
In ConstLowering: Move transformer logic to another class to avoid mutable state. Avoid marking all files in module as module. Support of inner classes.

#KT-46506 Fixed
2021-09-22 01:55:18 +03:00
Kristoffer Andersen 247cbffbac [EE-IR] Fragment Compiler Entrypoint in IR Backend
This commit introduces a new entrypoint for the IR backend, and starts
the work of accomodating the evaluator in psi2ir.

The evaluator expects a certain class and method structure of the
compiled fragment, but PSI is only supplied for the actual fragment.

So, to that end, this commit introduces a new "front end" of psi2ir
that "synthesizes" the module, class and method structure around the
fragment before calling into the existing psi2ir pipeline to obtain
the IR for the fragment.

The primary complication so far is handling the captured variables of
the fragment: they are mapped to parameters of the method surrounding
the fragment, and passed as arguments on evaluation. Hence, the IR
translation of the fragment needs to remap captured variables to the
appropriate parameter, in essentially all places they can be referred
to in the fragment (and hence in psi2ir). This commit introduces a
decorated symbol table that intercepts symbol look-ups and remaps as
appropriate.

Other cases that dispatches based on descriptor (see
`CallGenerator.kt`) needs other metadata to generate correct code.

It also introduces a shim in DeserializedContainerSource in the psi2ir
pipeline to facilitate facade class generation for the code that is
being debugged (which are generated as "external ir declarations").

Finally, in passing we resolve a small leftover from previous
refactoring that left an asssertion re. allowing IR to _assign_ to
parameters of methods.
2021-09-21 18:18:30 +02:00
Andrey Uskov 4ad828f80f [JPS] Improved processing of broken caches
If serialized metadata version has evidently incorrect size the module
should be marked for rebuild prior to reading serialized version.

#KT-42194 Fixed
2021-09-21 10:41:12 +03:00
Dmitriy Novozhilov 0f6b6dbca3 [FIR] Cleanup and reorganize utils in :compiler:fir:checkers 2021-09-15 17:11:31 +03:00
Dmitriy Novozhilov 9d09b9605f [FIR] Cleanup and reorganize utils in :compiler:fir:java 2021-09-15 17:11:30 +03:00
Dmitriy Novozhilov 7a347b11e3 [FIR] Use StandardClassIds instead of StandardNames everywhere it's possible 2021-09-15 17:11:30 +03:00
Dmitriy Novozhilov 5c2a3bb78e [FIR] Move duplicating names and classIds to StandardClassIds 2021-09-15 17:11:29 +03:00
Alexander Udalov e857966edb JVM: remove support for disabling NoConstantValueAttributeForNonConstVals
This feature is enabled by default since 1.4, which is the earliest
language version supported by Kotlin at this moment.
2021-09-14 22:29:12 +02:00
Ilya Kirillov a8d321db63 FIR IDE: do not use FE1.0 compiler jars in frontend-independent-modules 2021-09-14 14:45:43 +02:00
Ivan Kochurkin a816bd9a33 [FIR] Add JVM_INLINE_WITHOUT_VALUE_CLASS, VALUE_CLASS_WITHOUT_JVM_INLINE_ANNOTATION 2021-09-13 20:49:00 +03:00
Dmitriy Novozhilov 5769d42248 [FIR] Fix all usages of annotations due to new FirAnnotation hierarchy 2021-09-13 13:53:12 +03:00
Dmitriy Novozhilov 70e8d23d6b Fix new warnings in project code 2021-09-12 16:19:33 +03:00
Nikolay Lunyak 56b2a984ce [FIR] Quick fix FirModifierChecker 2021-09-11 22:05:35 +03:00
Aleksei.Cherepanov cc5382b37e [JPS] Fix incremental build after changing Java constant
InlineConstantTracker implemented for tracking changed java static final constants, that used in kotlin.

#KT-46506 Fixed
2021-09-11 13:00:00 +03:00
Ivan Kochurkin 8cdb79f969 Move JvmNames, JvmFieldApplicabilityProblem to common.jvm module 2021-09-10 00:49:10 +03:00
Ivan Kochurkin 69a13a3269 [FIR] Use getAnnotationByClassId instead of getAnnotationByFqName in JVM checkers 2021-09-10 00:49:09 +03: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