Commit Graph

4738 Commits

Author SHA1 Message Date
Anna Kozlova c628382b29 [AA] keep nullability for the recreated type
...when computing receiver type for double colon expression

^KT-65930 fixed
2024-02-20 08:50:04 +00:00
Jinseong Jeon 6f6496d78a AA: remove redundant code
computeIfAbsent right below will do the same thing
2024-02-19 21:54:22 +00:00
Jinseong Jeon 7911207734 AA: remove unused jar file system from KotlinStaticDeclarationProviderFactory 2024-02-19 21:54:21 +00:00
Dmitrii Gridin d64fc9b777 [SLC] map kotlin.Unit type typealias into void return type
^KT-65843 Fixed
2024-02-19 21:24:42 +00:00
Dmitrii Gridin 8dd66c0810 [LC] add test on unit type actualization
^KT-65843
2024-02-19 21:24:42 +00:00
Ivan Kochurkin 04ead1716a [FIR] Prohibit constructor and supertype on typealias with type projection
Introduce `CONSTRUCTOR_OR_SUPERTYPE_ON_TYPEALIAS_WITH_TYPE_PROJECTION`

^KT-60305 Fixed
2024-02-19 19:27:28 +00:00
Anna Kozlova a0fef89423 [AA] take resolved type of FirThisReceiverExpression
...when computing receiver type for double colon expression

^KT-65914 fixed
2024-02-19 16:25:21 +00:00
Dmitrii Gridin 68e5fc7344 [LL FIR] LLFirLazyResolver: drop LLFirLockProvider parameter
It can be inferred from `LLFirResolveTarget` inside
`LLFirTargetResolver`
2024-02-19 09:41:22 +00:00
Dmitrii Gridin efeffb45b7 [LL FIR] LLFirLazyResolver: drop ScopeSession parameter
It can be inferred from `LLFirResolveTarget` inside
`LLFirTargetResolver`
2024-02-19 09:41:22 +00:00
Dmitrii Gridin 7d672cd474 [LL FIR] drop ScopeSession parameter from LLFirModuleLazyDeclarationResolver
This parameter was required for on-air analysis
to avoid garbage in the original scope session.
Now we can drop it, and it will be less error-prone
2024-02-19 09:41:22 +00:00
Dmitrii Gridin 80b698ce32 [FIR] drop obsolete FirResolveContextCollector
This interface is unused
2024-02-19 09:41:22 +00:00
Dmitrii Gridin 2e17d8d524 [LL FIR] FileStructureElementDiagnosticRetriever: deduplicate code 2024-02-19 09:41:22 +00:00
Dmitrii Gridin 3f31bdb877 [LL FIR] merge DeclarationBaseStructureElement into FileStructureElement
To simplify the implementation
2024-02-19 09:41:22 +00:00
Dmitrii Gridin a9f7c153d2 [LL FIR] rename LLFirResolveMultiDesignationCollector to LLFirResolveDesignationCollector
As it is not "multi" after 77c850f0d0
2024-02-19 09:41:22 +00:00
Dmitrii Gridin 0ecb174720 [LL FIR] LLFirLazyResolver: deduplicate code 2024-02-19 09:41:22 +00:00
Dmitrii Gridin 84f3cc9f9c [Analysis API] drop obsolete code 2024-02-19 09:38:18 +00:00
Dmitriy Novozhilov acf2296590 [Test] Regenerate tests after two previous commits 2024-02-16 12:48:24 +00:00
Pavel Kunyavskiy 0fa42a9c11 [Tests] More conservative stableOrdered dump
Order of enum entries and fields matters, we can't sort them too.

^KT-65460
2024-02-16 10:19:38 +00:00
Jinseong Jeon 460339870a K2 UAST: lookup declarations mangled due to value class
^KT-65653 fixed
2024-02-15 17:02:04 +00:00
Jinseong Jeon 7e65f125cc Reproduce wrong binary resolution to fun w/ value class
^KT-65653
2024-02-15 17:02:03 +00:00
Nikolay Lunyak 8f8c7fe7cf [FIR] Properly calculate visibilities
`testIntersectionOfPrimitiveBasedFunctions`
is fine, because we deprecate this
already in ^KT-63243.

`CANNOT_INFER_VISIBILITY` is
positioned as `DECLARATION_NAME`,
just in case we decide for
some reason that we do want to
report it along with
`MANY_*_NOT_IMPLEMENTED`. In that
case, we'd get a problem that
their bounds overlap, but not
completely contain one another.

^KT-63741 Fixed
^KT-59400 Fixed
2024-02-15 16:10:14 +00:00
Nikolay Lunyak 7056ad5325 [FIR] Set status.isOverride for fake overrides
Even though SO may not be correct
overrides sometimes, it feels more
natural to treat fake overrides as...
well, "overrides". And without it
we'd need to make the code in
`FirOverrideChecker` less intuitive.
2024-02-15 16:10:13 +00:00
Nikolay Lunyak afd8895e51 [FIR] Introduce the PluginGenerated source kind
Make parcelize work consistently with
`FirOverrideChecker`.

Actually, there is a philosophical question about
what to do when a plugin generates a class
in a new package, and this class is red code
(for instance, doesn't implement an abstract
member from a supertype). There's no source
to report such an error, but we probably do
want to run checkers to avoid trying to
compile red code to binaries (because it may
crash in backend, or it may silently work).
2024-02-15 16:10:13 +00:00
Nikolay Lunyak 3b5fff5473 [FIR] Don't copy VP default values for fake overrides
In general, overrides should not
contain default values, and it's
better to make fake overrides be close
to proper overrides as much as
possible. It will be important when
we begin running `FirOverrideChecker`
for fake overrides.

^KT-63879 Fixed
^KT-65534
2024-02-15 16:10:13 +00:00
Nikolay Lunyak 249886fb13 [FIR] Ensure the case from KT-63741 works
^KT-63741
2024-02-15 16:10:13 +00:00
Nikolay Lunyak 2ad0be7bdc [FIR] Ensure the case from KT-63578 works
^KT-63578
2024-02-15 16:10:12 +00:00
Dmitrii Gridin c78d3edd24 [SLC] support type parameter annotations
^KT-65112 Fixed
2024-02-15 15:18:02 +00:00
Dmitrii Gridin ae8e9749c8 [SLC] AnnotationsBox: use PsiElement instead of PsiModifierList
Not only PsiModifierList can be the parent of an annotation,
so we should make the restrictions less aggressive.

^KT-65112
2024-02-15 15:18:02 +00:00
Dmitrii Gridin 3e3c932bf6 [LC] add tests on type parameter annotations
^KT-65112
2024-02-15 15:18:02 +00:00
Dmitrii Gridin d5705af8b1 [SLC] AbstractSymbolLightClassesParentingTestBase: make aware of PsiTypeParameter
It can have annotations

^KT-65112
^IDEA-346155
2024-02-15 15:18:02 +00:00
Stanislav Ruban 9fb920874c [tests] Add additional test data for KT-64222 2024-02-15 13:22:23 +00:00
Dmitriy Novozhilov b87aa470dd [Test] Ensure FIR doesn't fail on recursive private-to-this case
^KT-55446
2024-02-15 13:08:36 +00:00
Kirill Rakhman 81e0abeb8f [FIR] Fix mapped constructor hiding logic
Partially reverts 24367e0ad8

Constructors have their own list of hidden/visible.
We now require the constructor to be in VISIBLE_CONSTRUCTOR_SIGNATURES,
everything else is hidden.
This makes it unnecessary to check HIDDEN_CONSTRUCTOR_SIGNATURES

#KT-65821 Fixed
2024-02-15 13:08:15 +00:00
Dmitriy Novozhilov 84f0f6e099 [FIR] Resolve statuses of supertypes for all non-source classes
Previously we forced computation only for java and precompiled classes,
  assuming, that binary class can not extend source class, but it's not
  true in two cases:
1. Classpath substitution: class with same name declared in library and
   the source (more rare case)
2. Metadata compilation: depends-on dependcies are passed in binary
   format, so `expect class` may be a binary one and corresponding
   `actual class` may be a source. So if some class in `common` module
   extend this expect class, actual class will be substituted instead of it

^KT-65669 Fixed
2024-02-15 12:18:48 +00:00
Dmitrii Gridin 3962f26583 [FIR] PsiRawFirBuilder: drop obsolete LL FIR parts 2024-02-15 10:50:47 +00:00
Dmitrii Gridin 58a1662c02 [LL FIR] FirLazyBodiesCalculator: drop obsolete logic for compiler required annotations
We have custom logic on `LLFirCompilerRequiredAnnotationsTargetResolver`
side
2024-02-15 10:50:47 +00:00
Dmitrii Gridin f5f3b7fec0 [LL FIR] drop unused declarations 2024-02-15 10:50:47 +00:00
Dmitrii Gridin 8f83e2ab4d [LL FIR] drop RawFirUserTypeRefBuilder as obsolete 2024-02-15 10:50:47 +00:00
Dmitrii Gridin c1205bfba9 [LL FIR] drop RawFirFileAnnotationBuilder as obsolete 2024-02-15 10:50:47 +00:00
Dmitrii Gridin fd74de6ccf [LL FIR] drop RawFirReplacement as obsolete 2024-02-15 10:50:47 +00:00
Dmitrii Gridin ba947fbf04 [LL FIR] RawFirNonLocalDeclarationBuilder: drop redundant functions
They are obsolete as we dropped on-air resolution logic
2024-02-15 10:50:47 +00:00
Kirill Rakhman 879cdd5952 [FIR] Fix flattening of substitution overrides of intersection overrides for subsumed check
#KT-65555 Fixed
2024-02-15 08:43:06 +00:00
Roman Efremov 3994e3f63a [FIR] Deprecate using typealias as callable qualifier in import
^KT-64350 Fixed
2024-02-15 08:37:02 +00:00
Ilya Kirillov d925d3be76 [Analysis API] Fix Unexpected FirClassLikeSymbol null for class org.jetbrains.kotlin.fir.types.ConeClassLikeErrorLookupTag exception
on calling `asPsiType` on an unresolved type with type arguments

 ^KT-65550 fixed
2024-02-15 06:38:47 +00:00
Ilya Kirillov 50d526fe91 [Analysis API] Check all possible combinations of arguments in tests for KtType.asPsiType() 2024-02-15 06:38:47 +00:00
Vladimir Sukharev bf0150108d [K/N][Tests] Move filecheck and cinterop tests to /native/
^KT-61259
2024-02-14 23:36:34 +00:00
Alexander Udalov 41ef3da5ff Tests: add regression test for KT-63448 2024-02-14 21:44:42 +00:00
Dmitrii Gridin 46d16dfb6c [LL FIR] PersistenceContextCollector: change designation path resolution order
We will process more specific declaration firstly to avoid contention.
As the next step of addbb713a5

^KT-65780
2024-02-14 17:53:31 +00:00
Dmitrii Gridin 78c394d4de [LL FIR] FirElementBuilder: search file header elements without body resolution
^KT-65780
2024-02-14 17:53:31 +00:00
Dmitrii Gridin 04a2d6b616 [LL FIR] FirElementBuilder: make getFirForNonBodyElement more abstract
This is required for the next step

^KT-65780
2024-02-14 17:53:31 +00:00