Commit Graph

1829 Commits

Author SHA1 Message Date
Dmitrii Gridin 69d308edac [SLC] change 'inh.txt' extension to 'inheritors.txt' for tests 2022-12-13 16:54:25 +00:00
Dmitrii Gridin aa625ffb0d [SLC] implement 'isInheritor' for 'DefaultImpls'
^KT-55442 Fixed
2022-12-13 16:54:25 +00:00
Dmitrii Gridin b2c0a37050 [SLC] implement infrastructure for light class hierarchy tests 2022-12-13 16:54:25 +00:00
Dmitrii Gridin feff03894f [SLC] fix testData dir name 2022-12-13 16:54:24 +00:00
Ilya Kirillov 573811a199 [LL FIR] make FirDesignation.path type more precise. I's always a FirRegularClass 2022-12-13 13:16:33 +00:00
Ilya Kirillov cd83fec078 [LL FIR] fix lazy resolve of status for the members of the nested class
^KTIJ-23932 fixed
2022-12-13 13:16:32 +00:00
Ilya Kirillov 7bac119f20 [FIR] add lazy resolution contract checks in resolve 2022-12-12 16:21:06 +00:00
Mikhail Glukhikh df5aa59185 K2: Don't use FirTypeParameterSymbol.resolvedBounds() from inference 2022-12-12 16:21:05 +00:00
Roman Golyshev 9702b97d8d [kotlin] KTIJ-23832 Select proper argument for Kotlin annotations in KtDefaultAnnotationArgumentReference
Kotlin annotations can be called without named parameters even if their
names are different from `value`. So there's no need to search for the
property named "value", since there might be none
2022-12-12 14:13:42 +01:00
Jinseong Jeon cc7083d59e SLC: implement PsiMethod#getThrowsList 2022-12-11 15:22:11 +00:00
Ilya Kirillov b75bd179d4 [LL FIR] remove checkPce parameter from resolve, now we always check for PCE 2022-12-09 16:21:09 +00:00
Ilya Kirillov c2c615be99 [LL FIR] rework lazy annotation resolve for file to remove hacks
The previous solution blocked implementation of parallel resolve
2022-12-09 16:21:08 +00:00
Ilya Kirillov 3ad2b8a209 [LL FIR] rework FirDeclarationDesignation, so it can work with FirElementWithResolvePhase as a target 2022-12-09 16:21:08 +00:00
Dmitriy Novozhilov bd3a28d04d [FE 1.0] Report INTEGER_OPERATOR_RESOLVE_WILL_CHANGE in missing cases
Covered places:
- local properties
- vars
- return positions of functions and lambdas

^KT-45970 Fixed
^KT-55358 Fixed
2022-12-09 15:10:03 +00:00
Dmitriy Novozhilov a979960e63 [FE 1.0] Add test for KT-45970 2022-12-09 15:10:02 +00:00
Dmitriy Novozhilov 3cffb33ab7 [FE] Drop ApproximateIntegerLiteralTypesInReceiverPosition language feature
This feature is not needed because it is unconditionally disabled for K1
  (because of not fully correct implementation) and unconditionally enabled
  in K2 (K2 does not support old behavior)

^KT-38895
2022-12-09 15:10:02 +00:00
Mikhail Glukhikh d5c8d9fecc FE: add test reproducing KT-54411 2022-12-09 15:00:38 +00:00
Dmitriy Novozhilov d898e256ca [FIR] Don't update explicit delegated constructor calls of classes with @JvmRecord
^KT-54573 Fixed
2022-12-09 12:02:08 +00:00
Dmitriy Novozhilov 2aad466d00 [FIR] Add test for KT-55286 2022-12-09 12:02:08 +00:00
Dmitriy Novozhilov f3da26946b [FIR] Change priority of K2_VISIBILITY_ERROR CandidateApplicability
In K1 analogue of `K2_VISIBILITY_ERROR` is `K1_RUNTIME_ERROR`, so
  candidates with `K2_VISIBILITY_ERROR` should win over innaplicable
  candidates with `INAPPLICABLE`, `INAPPLICABLE_ARGUMENTS_MAPPING_ERROR`
  or `INAPPLICABLE_WRONG_RECEIVER` applicability

This is needed to allow resolution to invisible symbols (and later
  suppress error with `@Suppress("INVISIBLE_SYMBOL", "INVISIBLE_REFERENCE")`

^KT-55026 Fixed
^KT-55234
2022-12-09 12:02:05 +00:00
Egor Kulikov dbfe33c00d [FIR] Make default values for value parameters lazy in RawFirBuilder
Sixth step for ^KT-52615

Merge-request: KT-MR-7926
Merged-by: Egor Kulikov <Egor.Kulikov@jetbrains.com>
2022-12-08 13:32:37 +00:00
Yan Zhulanow c8e9cfde0b [FE] Read Java static field initializer lazily (KTIJ-23043) 2022-12-08 10:46:43 +00:00
Dmitriy Novozhilov 44fd9ddf85 [Test] Add test for KT-55338 2022-12-08 10:19:36 +00:00
pyos 06b71f8300 FIR DFA: drop data flow edges from postponed lambdas in return values
This is a temporary hack to avoid compiler crashes in some code that
uses builder inference, conditional early returns from lambdas, and
expected types in a certain way. It is not correct - dropping data flow
edges never is - but it is much easier to implement for now than a
proper fix.
2022-12-08 10:19:36 +00:00
pyos d66be3f82d FIR CFG: do not assume all arguments to inline funs are called in place
Only values for non-noinline, non-crossinline, functional type
parameters qualify.
2022-12-08 10:19:32 +00:00
pyos 8d2ac141c3 FIR DFA: split Flow into PersistentFlow and MutableFlow
The distinction is similar to persistent data structures and their
builders. Only the MutableFlow can be passed to LogicSystem for
modification; when it's ready, it can be converted into PersistentFlow
and attached to a CFG node.

The result is that the API is cleaner, the implementation is a bit more
neat, and hopefully the use of PersistentHashMap.Builder improves
performance a little. Also the node-to-flow map can now be removed in
favor of just storing PersistentFlow inside a node, seeing as it's
explicitly immutable and all that.
2022-12-08 10:19:28 +00:00
pyos 1232346202 Minor: merge FirSamResolver and its only implementation 2022-12-07 22:09:20 +00:00
pyos 0d46dfc1ba FIR: fix substitution of type arguments in SAM type aliases
^KT-54730 Fixed
2022-12-07 22:09:20 +00:00
pyos 3253789093 FIR: move typealias SAM constructor computation to FirSamResolver 2022-12-07 22:09:19 +00:00
Dmitrii Gridin 5c9aa88617 [AA] KtModule#project shouldn't be null
^KT-55336
2022-12-07 14:18:44 +00:00
Dmitrii Gridin 9f82c43b1b [SLC] replace requireNotNull with regular exception
^KT-54051
2022-12-07 11:53:13 +01:00
Dmitrii Gridin cc9beb466e [SLC] SymbolLightClassForEnumEntry: shouldn't be regular class
^KTIJ-23842 Fixed
2022-12-07 08:41:19 +00:00
Ilya Kirillov a297240870 [LL FIR] fix a memory leak from LLFirNonUnderContentRootSessionFactory 2022-12-06 23:05:27 +00:00
Ilya Kirillov 2f2aa5ed6f [LL FIR] invalidate caches on exceptions in more places where we modify some fir elements 2022-12-06 21:20:42 +00:00
Ilya Kirillov 7a89ca495c [LL FIR] do not execute resolve under a non-cancellable session
The sessions are invalidated on the PCE
2022-12-06 21:20:41 +00:00
Ilya Kirillov 3d68eb27d5 [LL FIR] do not use LLFirModuleLazyDeclarationResolver directly
use lazyResolveToPhase instead for consistency
2022-12-06 21:20:41 +00:00
Marco Pennekamp 2cd16f055a [AA] KT-55098 Render context receivers in declarations & function types
- `context(...)` is a modifier that must precede annotations and other
  modifiers, so for declarations it is rendered in
  `renderAnnotationsAndModifiers`.
- Ignore `@ContextFunctionTypeParams` in the annotation list of FE10
  types, as the annotation is an implementation detail of context
  receivers in K1 and shouldn't be rendered.

^KT-55098 fixed
2022-12-06 17:43:30 +00:00
Marco Pennekamp e2804693bf [AA] KT-55098 Add context receivers to KtFunctionalType
- Context receivers in function types may not be labeled, so the created
  `KtContextReceiver`s have `null` labels. Such labels currently only
  compile due to a bug (see KT-55187).
2022-12-06 17:43:29 +00:00
Marco Pennekamp 2851622a6f [AA] Fix typos in renderers 2022-12-06 17:43:29 +00:00
Dmitrii Gridin 8a9acfcab0 [SLC] SymbolLightModifierList: replace custom loop with compareAndSet with updateAndGet
^KTIJ-23783
2022-12-06 13:40:50 +00:00
Dmitrii Gridin 3ee451c873 [SLC] SymbolLightFieldForObject: reduce allocations number
^KTIJ-23783
2022-12-06 13:40:49 +00:00
Dmitrii Gridin 91586705b3 [SLC] SymbolLightSimpleMethod: reduce allocations number
^KTIJ-23783
2022-12-06 13:40:49 +00:00
Dmitrii Gridin c5c79a5fb5 [SLC] SymbolLightModifierList: improve equals
^KTIJ-23783
2022-12-06 13:40:48 +00:00
Dmitrii Gridin 2ec09408d3 [SLC] SymbolLightModifierList: avoid redundant array allocation
^KTIJ-23783
2022-12-06 13:40:48 +00:00
Dmitrii Gridin a7390d027a [SLC] migrate from ImmutableHashMap to PersistentHashMap
^KTIJ-23783
2022-12-06 13:40:48 +00:00
Dmitrii Gridin 9bc37d7f3f [SLC] introduce some utils
^KTIJ-23783
^KTIJ-23519
2022-12-06 13:40:47 +00:00
Dmitrii Gridin 856d272ca4 [SLC] implement lazy calculation for modifiers
and fix some annotations

^KTIJ-23783 Fixed
2022-12-06 13:40:47 +00:00
Dmitrii Gridin e2082fb0d7 [SLC] fix visibility for lateinit properties from companion
^KTIJ-23519 Fixed
2022-12-06 13:40:46 +00:00
Dmitrii Gridin 7bfa900ce6 [SLC] fix modality for methods and property accessors
^KTIJ-23783
2022-12-06 13:40:46 +00:00
Dmitrii Gridin 00ab33bbf9 [SLC] extract non-common logic from computeModalityForMethod
^KTIJ-23783
2022-12-06 13:40:45 +00:00