Commit Graph

1829 Commits

Author SHA1 Message Date
aleksandrina-streltsova fb9dead107 [Analysis API] consider applicable extensions that require receiver cast
^KTIJ-23715
2022-12-27 17:22:30 +00:00
Roman Efremov 25f65aff3a Replace getEntries with hardcoded PsiMethod in LC decompiled declaration
This adds NotNull annotation.

^KTIJ-23530 Fixed
2022-12-27 14:41:53 +00:00
Roman Efremov cbb20ce2b8 Don't generate getEntries method in light classes when feature disabled
^KTIJ-23530 Fixed
2022-12-27 14:41:53 +00:00
Roman Efremov e5d5cbc7a3 Generate Enum.getEntries method in ultra light classes
^KTIJ-23530 Fixed
2022-12-27 14:41:52 +00:00
Ilya Kirillov 4d7e9b2d5a [FIR] add possibility to specify initialCapacity and loadFactor in FirCachesFactory.createCache 2022-12-27 13:27:23 +00:00
Yan Zhulanow d652dc620c [FE] Preserve legacy contract description calls in bodies
^KT-55231 Fixed
^KTIJ-21012 Fixed
2022-12-26 11:46:58 +00:00
Anna Kozlova 15b1e429d7 [compiler] introduce dedicated Fir declaration for dangling modifier lists (KTIJ-23008)
ensure fir annotations are included in FirDanglingModifierList and resolved,
dedicated DanglingTopLevelModifierListStructureElement exists for top
level lists only, class level lists are processed by containing structure
element
2022-12-21 20:58:46 +00:00
Ilya Chernikov a89dfdce03 K2 Scripting: add support for script args to FIR part 2022-12-21 14:34:20 +00:00
Anna Kozlova b81c210535 [AA] resolve array access expression to corresponding set operator
k1 would suggest `get` as well
 but with current fir structure with fake desugaring
 get is moved to the separate fake psi which doesn't exist
 thus the problem is ignored for now
 ^ KTIJ-24025
2022-12-21 10:45:40 +00:00
Jinseong Jeon 4beb55179b AA: expected type for expression passed to vararg 2022-12-21 17:05:00 +09:00
Evgeniy.Zhelenskiy ac28c0a286 [IR] Allow inline modifier for functions returning MFVC without warning
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
2022-12-20 21:26:56 +00:00
Dmitrii Gridin 90d702ed27 [SLC] symbolAnnotationsUtils: use AnnotationTarget and ElementType to reduce custom strings
^KT-55481
2022-12-20 19:52:15 +00:00
Dmitrii Gridin 3c0f3777c6 [SLC] symbolAnnotationsUtils: reuse DEFAULT_VALUE_PARAMETER
^KT-55481
2022-12-20 19:52:14 +00:00
Dmitrii Gridin 65426f6b40 [LC] KotlinClassInnerStuffCache: drop unused code
^KT-55497
2022-12-20 19:52:14 +00:00
Dmitrii Gridin c77401d823 [SLC] drop redundant 'final' modifier from synthetic enum members
^KT-55502 Fixed
2022-12-20 19:52:14 +00:00
Dmitrii Gridin 8bbe60e96c [AA] add more tests on companion members 2022-12-20 19:52:13 +00:00
Dmitrii Gridin 0f29edec15 [SLC] LazyModifiersBox: fix typo 2022-12-20 19:52:13 +00:00
Dmitrii Gridin bb51d62e0a [SLC] support static properties (e.g. Enum.entries)
^KT-55496
^KTIJ-23530
2022-12-20 19:52:13 +00:00
Dmitrii Gridin 643b74fa28 [AA FIR] support symbol pointers for static properties
^KT-55487
2022-12-20 19:52:12 +00:00
Dmitrii Gridin e39dc9b768 [LC] fix signature of 'Enum.valueOf()'
* drop @NotNull annotation from parameter
* add NullPointerException to throws

^KT-55497 Fixed
2022-12-20 19:52:12 +00:00
Dmitrii Gridin 7d0c093da7 [SLC] generate static enum methods from symbols
^KT-55496 Fixed
2022-12-20 19:52:11 +00:00
Dmitrii Gridin c28e9d5253 [LC] add tests for enum classes
^KT-55496
^KTIJ-23530
2022-12-20 19:52:11 +00:00
Dmitrii Gridin e476150025 [AA FIR] support symbol restoring for static members
^KT-55487 Fixed
2022-12-20 19:52:10 +00:00
Dmitrii Gridin f3c7972d20 [SLC] implement java annotations for annotation classes
^KT-55481 Fixed
2022-12-20 19:52:10 +00:00
Dmitrii Gridin 1e1525bae5 [SLC] implement light class for RepeatableContainer
^KT-55470 Fixed
2022-12-20 19:52:10 +00:00
Dmitriy Novozhilov 02e327277e [FIR] Report VAL_REASSIGNMENT on assign to non-local vals
In this commit reporting on member properties in init section of class
  is not supported (see KT-55528)

^KT-55493 Fixed
2022-12-20 08:12:09 +00:00
Dmitriy Novozhilov 4bddb27ca3 [FIR] Get rid of candidateSymbol in FirNamedReference
`candidateSymbol` has any reasonable meaning only for references with
  not completed candidate, so this property is moved from FirNamedReference
  to new node FirNamedReferenceWithCandidateSymbol, which has real
  implementation only in :resolve module (`FirNamedReferenceWithCandidate`)
2022-12-20 08:12:07 +00:00
Artem Vasilev 1e1f96f73e [LL FIR] fix more possible NPEs at lock access
Depending on the execution, some accesses to lock could cause NPE.
The best solution we've found so far is to make lock volatile, so that
reads between lock and value are consistent between threads.
It requires further work to determine if we can have one volatile field.
2022-12-16 17:56:49 +00:00
Artem Vasilev 04924dbfed [LL FIR] replace guard with ReentrantLock.holdCount
Previously, there was a guard variable that prevented recursive
locks. It can be replaced with lock.holdCount check.
2022-12-16 17:56:49 +00:00
Artem Vasilev 879f6c3432 [LL FIR] restructure lock assertion to prevent NPEs
When the other thread has already computed the value and cleared the
lock, the other thread could still enter the computeValueWithoutLock()
and see lock == null
2022-12-16 17:56:49 +00:00
Ilya Kirillov 561df74419 [kotlin] fix NPE from lockWithPCECheck when action lambda returns a nullable value 2022-12-16 17:17:13 +01:00
Anna Kozlova a529f8510d [LL] ensure FirConstExpression's annotations are not lost (KTIJ-23968) 2022-12-15 14:31:48 +00:00
Dmitriy Novozhilov 7334694fd9 [FIR] Remove some rare used utilities 2022-12-15 12:12:20 +00:00
Dmitriy Novozhilov b53c4a6353 [FIR] Introduce some typed FirReference.toResolvedXXXSymbol utilities 2022-12-15 12:12:20 +00:00
Dmitriy Novozhilov cffc32ec76 [FIR] Fir utils for FirReference in package org.jetbrains.kotlin.fir.references 2022-12-15 12:12:20 +00:00
Dmitriy Novozhilov b174bb8844 [FIR] Update testdata after introducing FirResolvedErrorReference 2022-12-15 12:12:19 +00:00
Dmitriy Novozhilov dde64c10ea [FIR] Create FirResolvedErrorReference for error reference with single candidate
Note that this reference won't be created for hidden candidates,
  because they are designed to be truly invisible from the user side
2022-12-15 12:12:19 +00:00
Mikhail Glukhikh b271b409c7 Fix final -> open modality in new test data after 2022-12-14 23:19:37 +01:00
Steven Schäfer 6af616d3c3 FIR: make declarations marked with 'override' implicitly open
#KT-52236 Fixed
2022-12-14 21:46:41 +00:00
Ilya Kirillov 68a17242b3 [FIR] fix NPE on missing java annotations qualifier
^KTIJ-23075 fixed
2022-12-14 09:58:07 +00:00
Ilya Kirillov 8b88315a69 [LL FIR] do not allocate lambda for the ValueWithPostCompute.guard
to reduce a memory consumption for a little

ValueWithPostCompute are created very often
2022-12-14 08:33:07 +00:00
Ilya Kirillov 2bb3b41348 [LL FIR] clear implementation details in ValueWithPostCompute after the value is computed
to save some memory
2022-12-14 08:33:07 +00:00
Ilya Kirillov f9298d8e85 [LL FIR] try to check for PCE in ValueWithPostCompute to avoid possible deadlocks 2022-12-14 08:33:06 +00:00
Ilya Kirillov de7383ff15 [LL FIR] check for PCE after acquiring the lock for resolve
To the moment we acquire the lock, the computation might not be needed
2022-12-14 08:33:06 +00:00
Ilya Kirillov c80221afd3 [LL FIR] always use lockWithPCECheck for resolve to check possible PCE 2022-12-14 08:33:06 +00:00
Ilya Kirillov d7ee312b83 [Analysis API] do not rethrow java.lang.Error
Errors as OutOfMemoryError should not be caught or wrapped
2022-12-14 08:33:05 +00:00
Ilya Kirillov 9cf77e19be [LL FIR] fix memory leak from LLFirSessionProvider for the module
LLFirSessionProvider stores all transitive module dependencies,
even if they are not needed or already invalidated and garbage collected

Now, the dependencies are stored on the weak references, and so then nobody uses them, they will be garbage collected
2022-12-14 08:33:05 +00:00
Dmitrii Gridin 34e4645385 [ULC] avoid resolve from KtUltraLightClassModifierList.hasModifierProperty in most cases
^KT-55445 Fixed
2022-12-13 18:18:00 +00:00
Dmitrii Gridin cebccee4be [SLC] add inheritors testData for facade class 2022-12-13 16:54:26 +00:00
Dmitrii Gridin 66dc7a3168 [SLC] make inheritors testData more human-readable 2022-12-13 16:54:26 +00:00