Commit Graph

109648 Commits

Author SHA1 Message Date
Yan Zhulanow 690f39b91c [Analysis API] Minor, refactor 'createDumbVirtualFile()'
Pass the file name explicitly, and refine the dumb 'VirtualFile'
implementation.
2024-03-07 12:14:19 +00:00
Jinseong Jeon de4cce8dc8 AA: add support VirtualFile inputs to source module
^KT-65571 fixed
2024-03-07 12:14:19 +00:00
Jinseong Jeon 520ae725d1 Add test about dependsOn dependency and stdlib-common 2024-03-07 12:14:19 +00:00
Jinseong Jeon 6c062b0cea Add test about resolution to klib from non/common platforms 2024-03-07 12:14:19 +00:00
Jinseong Jeon 7f33097634 Fix typo in test input file name 2024-03-07 12:14:19 +00:00
Vladimir Sukharev a9af52c288 [Tests] Add test for KT-44199
^KT-44199 Fixed
2024-03-07 11:36:49 +00:00
Vladimir Sukharev 1ad0872958 [Tests] Port FilePathsInKlibTest to K2 ^KT-64452
Used frontend changed for K2
It turned out test was compiling only one source file (a.kt). Test adjusted, so all three source files(a.kt, b/c.kt, c/d/e.kt) are now compiled into klib, so more usecases are tested
^KT-64452 Fixed

Merge-request: KT-MR-14700
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2024-03-07 10:49:07 +00:00
eugene.levenetc 16d53a0e34 [ObjCExport] Fix kdoc primary constructor
KT-66387
2024-03-07 10:32:36 +00:00
Mikhail Glukhikh c04a8fc3b8 K1/K2: add test cases for KT-53792 and KT-66369 2024-03-07 10:25:11 +00:00
Jinseong Jeon 09f384d96e FIR: assure annotation argument mapping is ready
^KT-66223 fixed
2024-03-07 10:17:01 +00:00
Jinseong Jeon f3ed9476a3 SLC: remove unused/redundant utils
KtTypeInfoProvider has many other variants like that,
e.g., KtType.(isUnit | isInt | isLong | ...)
2024-03-07 10:17:01 +00:00
Jinseong Jeon afd20b0c2d SLC: honor wildcard suppression on declarations
^KT-61734 fixed
2024-03-07 10:17:00 +00:00
Jinseong Jeon d63b3e9494 Extend JvmWildcardSuppress annotation tests
^KT-61734
2024-03-07 10:17:00 +00:00
Jinseong Jeon 9c16c52564 AA: pass wildcard suppression hints on declarations
^KT-61734
2024-03-07 10:17:00 +00:00
Jinseong Jeon d089db5a45 AA: honor wildcard suppression on type during type conversion
^KT-61734
2024-03-07 10:16:59 +00:00
Jinseong Jeon 94e5653eb7 Migrate utils to check/alter TypeMappingMode according to suppress wildcard annotations
^KT-61734
2024-03-07 10:16:59 +00:00
Jinseong Jeon d4d2bae630 AA: add tests about wildcard suppress
^KT-61734
2024-03-07 10:16:58 +00:00
Jinseong Jeon 5d730233cd Migrate Jvm(Suppress)?Wildcard(s)? FqName (and ClassId) 2024-03-07 10:16:58 +00:00
Sebastian Sellmair 10cf97f05b [ObjCExport] Support exported library modules
This new module gives the ability to resolve symbols
from provided klib KtLibraryModules withing a Analysis Session.

^KT-65327 Fixed
2024-03-07 09:23:37 +00:00
Sebastian Sellmair b5b7e5f262 [aa-klib-reader] Implement 'analysis-api-klib-reader' for swift- and objc export
This new module gives the ability to resolve symbols
from provided klib KtLibraryModules withing a Analysis Session.

^KT-65327 Fixed
2024-03-07 09:23:37 +00:00
Anastasia.Nekrasova 1bb6f869a2 [K2]: Compiler crashes when array literal is used in delegate expression
FirCallResolver tries to find a
candidate for the delegate's getValue and cannot parse an arrayLiteral
with a nullable coneType.Running
FirCallCompletionResultsWriterTransformer.transformArrayLiteral is
required to find the result type. Therefore, completeCall should not be
invoked with the ResolutionMode from the 'data' param, but rather in
ResolutionMode.ContextIndependent.

#KT-65022 Fixed
2024-03-07 08:57:24 +00:00
Vladimir Sukharev b4bc576d37 [Tests] Add test for kt33411
^KT-33411 Fixed


Merge-request: KT-MR-14782
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2024-03-07 08:46:05 +00:00
Dmitrii Gridin 928fb94052 [FIR] fix internal error on suspend conversion with not-computed return type
^KT-62836 Fixed
2024-03-07 07:49:44 +00:00
Dmitrii Gridin f4096ae8e9 [FIR] add test case on more suspend conversion with more specific implicit type
^KT-62836
2024-03-07 07:49:44 +00:00
Dmitrii Gridin edd9f0348e [LL FIR] LLFirReturnTypeCalculatorWithJump: add checkCanceled
`tryCalculateReturnTypeOrNull` is the entry point for foreign symbols
resolution. We already have `checkCanceled` inside `lazyResolveToPhase`
and `checkIsResolved`, but in this case we will cover cases where
everything around is already resolved

^KTIJ-27504
2024-03-07 07:43:40 +00:00
Yan Zhulanow 4cbd431d22 [Pill] Enable Pill for scripting tests 2024-03-07 06:25:00 +00:00
Yan Zhulanow 507ab1e619 [Pill] Enable Pill for Swift export modules 2024-03-07 06:25:00 +00:00
Alexander Udalov 7d4ad9d9f9 JVM IR: slightly optimize IrType.asJvmFlexibleType
#KT-66281
2024-03-06 22:03:10 +00:00
Alexander Udalov 47a4ee7fdf IR, JS: remove duplicate FQ name check from hasEqualFqName
`hasEqualFqName` is called from `hasAnnotation`, which takes more than
1% of total backend time, so it's important to avoid doing extra work
here.

It seems to be a quirk of the JS IR backend specifically that
`JsExport.Ignore` has incorrect IR parent structure here; for all other
backends, checking FQ name by traversing IR parents should work fine.

 #KT-66281
2024-03-06 22:03:10 +00:00
Alexander Udalov d430673320 JVM IR: optimize type equality check on IR types
`AbstractTypeChecker.isCommonDenotableType` calls a few functions which
check if the type is flexible, which is not cheap in case of JVM IR, see
`asFlexibleType`.

 #KT-66281
2024-03-06 22:03:10 +00:00
Alexander Udalov 45b74d0313 IR: simplify IrOverrideChecker.isOverridableByWithoutExternalConditions
Inline property-related utilities to the only call site, rearrange the
code to make declarations closer to their usages, etc.
2024-03-06 22:03:10 +00:00
Vyacheslav Gerasimov 879aa33a9c Build: Apply ConcurrencyLimitService to all tests tasks in the project
Some project tasks are not created with projectTest helper, but all
tasks should be limited since we can't use `--no-parallel` on CI
2024-03-06 21:45:41 +01:00
Jinseong Jeon b47a33cf9d Back to getOrDefault test
The main purpose was to test getOrDefault w/ non/null value does not
bother the resolution. To be aligned with test file
mapGetOrDefault_nullable.kt, this one should test getOrDefault too.
All we needed was // WITH_STDLIB
2024-03-06 19:26:52 +00:00
Wojciech Litewka cbabfc0fe2 [IR] Drop ir.ir2cfg module
#KTI-952 Fixed
#KT-65773 Related
2024-03-06 18:30:22 +00:00
Ilya Goncharov 6fb6f04509 [Gradle, Wasm] Not add target listeners for wasi projects
^KT-66373 fixed
2024-03-06 18:23:41 +00:00
Ilmir Usmanov 0bb6359ac5 Minor. Add regression tests
#KT-64725 Fixed
 #KT-64726 Fixed
 #KT-64727 Fixed
2024-03-06 18:16:59 +00:00
Svyatoslav Scherbina b4c2164837 [K/N][tests] Fix kt42208WithPassingLambdaToAnotherFunction.kt for K2
It seems that K2 doesn't support `UnitConversionsOnArbitraryExpressions`
experimental language feature (KT-56011), while the test accidentally
relied on it.

Improve the test code so that it doesn't need this language feature
anymore, and enable the test for K2.

^KT-65553 Fixed
2024-03-06 17:07:27 +00:00
Denis.Zharkov b7129f78a3 K2: Fix IAE at Candidate.updateSourcesOfReceivers inside PCLA lambda
Previously, it was failing at line
(resolvedReceiver?.toReference(session) as? FirNamedReferenceWithCandidate)?.candidate?.updateSourcesOfReceivers()

But this line was mostly incorrect because in case of `a.b()` call,
which is resolved to `a.b.invoke()`, `resolvedReceiver` is pointing to
`a` instead of obviously expected `a.b`.

The fix with using `candidate.callInfo.explicitReceiver` doesn't help
either because the candidate of that receiver is always completed at
that stage (so no Candidate there).

The only case when the candidate was still there is PCLA because
 in that case we explicitly don't fully complete even receiver
expressions.
(see docs/fir/pcla.md)

The idea of the fix is moving the call of `updateSourcesOfReceivers`
for invoke property receiver to the place just before the candidate
is being converted to the resolved reference
(i.e., the candidate is being lost)

^KT-66148 Fixed
2024-03-06 17:01:57 +00:00
Dmitrii Gridin ae9c9b051f [FIR] do not use MUTE_LL_FIR for multiplatform tests 2024-03-06 16:13:09 +00:00
Dmitrii Gridin c090ae96ab [LL FIR] update attached issue
^KT-66352
2024-03-06 16:13:09 +00:00
Dmitrii Gridin 124453016d [LL FIR] Replace IGNORE_REVERSED_RESOLVE + IGNORE_NON_REVERSED_RESOLVE with MUTE_LL_FIR 2024-03-06 16:13:09 +00:00
Dmitrii Gridin 9ea9950d28 [LL FIR] Replace IGNORE_DIAGNOSTIC_API with IGNORE_NON_REVERSED_RESOLVE 2024-03-06 16:13:09 +00:00
Dmitrii Gridin 28c80a1581 [LL FIR] StubBasedFirMemberDeserializer: add missed deprecation provider
^KT-60996 Fixed
2024-03-06 16:13:09 +00:00
Dmitrii Gridin 805b7bc8f4 [Analysis API] add diagnostic tests on deprecated declarations
^KT-60996
2024-03-06 16:13:09 +00:00
Dmitrii Gridin 9cc2c22116 [Analysis API] drop obsolete tests
They were renamed during 2ce324f1fc,
but old wasn't dropped
2024-03-06 16:09:43 +00:00
Dmitrii Gridin 1ba81fca57 [Analysis API] add tests on incomplete function type parameter symbol
^KT-65858 Obsolete
2024-03-06 16:09:43 +00:00
Dmitrii Gridin ca740b70f3 [LL FIR] LLFirLazyResolver: inline updatePhaseForDeclarationInternals
This is the responsibility of `LLFirTargetResolver` to call it
2024-03-06 16:06:21 +00:00
Dmitrii Gridin 141b187e37 [LL FIR] encapsulate checkIsResolved for LLFirResolveTarget
In this way, only `LLFirLazyResolver` will be responsible for running
and checking the resolution result.
Also, this commit replaces redundant `checkIsResolved` for
`LLFirResolveTarget` with cheaper `checkIsResolved` for declarations.
2024-03-06 16:06:21 +00:00
Dmitrii Gridin c4bb5c6d8f [LL FIR] mark LLFirTargetResolver and LLFirLazyResolver as sealed as we know hierarchy 2024-03-06 16:06:21 +00:00
Dmitrii Gridin 4db10a1d94 [LL FIR] drop ability to enable global phase lock
Also, this commit adds the missing global lock for `IMPORTS` phase.

This commit doesn't change any logic for the case with disabled lock
(the default case), only updates the case with enabled lock.

^KT-66306 Fixed
2024-03-06 16:06:21 +00:00