Commit Graph

109806 Commits

Author SHA1 Message Date
Dmitrii Gridin 2f2a17f570 [SLC] inject checkCanceled into declarations creation to improve responsiveness
^KTIJ-28688
2024-03-11 21:42:39 +00:00
Dmitrii Gridin 0ab105f265 [LC] KotlinAsJavaSupportBase: add checkCanceled
The jump from Kt into the Psi world is a good place to check
if we have been canceled

^KTIJ-28688
2024-03-11 21:42:39 +00:00
Vadim.Mishenev df1d44b15f KT-64051 [AA] Fix resolve of KDoc references to a typealias by full name 2024-03-11 21:38:09 +00:00
Vladimir Dolzhenko 8b7ca9527a Inject checkCanceled calls to improve responsiveness
#KTIJ-28688


Co-authored-by: Dmitrii Gridin <dmitrii.gridin@jetbrains.com>

Merge-request: KT-MR-14866
Merged-by: Vladimir Dolzhenko <Vladimir.Dolzhenko@jetbrains.com>
2024-03-11 20:47:30 +00:00
Igor Yakovlev 84a5a9ff53 Revert "[Wasm] Implement IrLinkageError end enable partial linker"
This reverts commit c0f387dbd1.
2024-03-11 19:27:12 +00:00
Dmitrii Krasnov a33e56a50d [Gradle IT] Added ivy with release k/n to IT tests default repos
^KT-64903
2024-03-11 18:33:16 +00:00
Brian Norman 9a5f4522e6 [PowerAssert] Update Gradle extension to be more idiomatic
Instead of using raw List types in the Gradle extension, ListProperty
should be used instead to make it more Gradle idiomatic. Also marking
the extension and all properties as experimental to allow easier
changing in the future.

^KT-65952 Fixed
2024-03-11 18:18:49 +00:00
Ilya Gorbunov ae3e770246 Update line numbers from stdlib in inlining and stepping tests 2024-03-11 18:12:27 +00:00
Ilya Gorbunov 7175680917 [stdlib] Specify EXACTLY_ONCE contract for useLines 2024-03-11 18:12:27 +00:00
Ilya Gorbunov ed8c71442b [stdlib] Use more idiomatic index range check in getOrElse/Null 2024-03-11 18:12:27 +00:00
Ilya Gorbunov fc13ae7b4d [stdlib] Specify AT_MOST_ONCE contract for default-value-like functional parameters KT-54879 2024-03-11 18:12:27 +00:00
Ilya Gorbunov dee9fdc02d [stdlib] Regenerate sources 2024-03-11 18:12:27 +00:00
Nikita Bobko 989ec97bb0 [FIR] Make FirNotImplementedOverrideChecker to run only for non-expect classes or in metadata compilation
^KT-64187 Fixed
Review: https://jetbrains.team/p/kt/reviews/14807

I also checked that IDE sets metadataCompilation to `true` (Actually, it
looks like IDE performs analysis two times with the flag having
different values, but whatever, maybe it's even better this way)
2024-03-11 18:07:52 +00:00
Nikita Bobko 9d566465e6 [test] Run checkers in metadata-like style to see what diagnostics metadata compilation omits
Review: https://jetbrains.team/p/kt/reviews/14807

Technically, *.ll.kt should have been covering that. But I see that
there slight differences
2024-03-11 18:07:52 +00:00
Nikita Bobko ab069cb7f4 [test] Use correct FirOutputPartForDependsOnModule for running checkers that run in common session
Review: https://jetbrains.team/p/kt/reviews/14807

Motivation: no motivation, I was just passing by and noticed this bug.

It looks like this commit doesn't affect any tests
2024-03-11 18:07:51 +00:00
Mikhail Glukhikh c4bcdc42c1 K2: don't count use-sites of Java type parameter with nullable bounds as not null 2024-03-11 18:05:04 +00:00
Mikhail Glukhikh d353fd400d K1/K2: add a test for KT-50008 2024-03-11 18:05:04 +00:00
Alexander Udalov 2f056fe155 JVM: remove StubClassBuilder and its usage
After legacy light classes were removed, the only remaining usage was in
KotlinLightClassBuilderFactory where we ran JVM backend in the
LIGHT_CLASSES mode, and that was only used from diagnostic tests to
report JVM backend diagnostics.

We don't actually need to build stubs here, so we can just use ASM's
class writer, which means that StubClassBuilder and all its dependencies
can be removed.
2024-03-11 18:03:49 +00:00
Sonya Valchuk e5ad035039 JVM: do not write trivial SMAPs to any classes
Even ones inside inline functions. This was a backwards compatibility
hack for Kotlin 1.4, where the inliner would crash if it attempted to
regenerate an anonymous object with no SMAP; that has been fixed in 1.5,
and ever since then trivial SMAPs could be inferred from line number
markers in methods.

There are three kinds of changes to tests in this commit:

  * Some SMAPs are gone entirely - self-explanatory.

  * Some SMAPs have narrower line ranges - that's because the old SMAP
    had the range for the entire file, while the new one only maps up to
    the last line number used in the class. There should be no
    difference in behavior.

  * Some "source file name" markers are removed in continuation objects
    - continuations don't have any line numbers, so there's no debugging
    information anyway. The actual source information is in the
    containing class.
2024-03-11 17:25:50 +00:00
Sonya Valchuk fc992274bb JVM: make SMAP utilities a little prettier 2024-03-11 17:25:50 +00:00
Vladimir Sukharev 64d4b61628 [Tests] Drop obsolete KotlinJavascriptSerializerTest.kt 2024-03-11 15:12:44 +00:00
Vladimir Sukharev 9b4f503fbe [Tests] Port KotlinKlibSerializerTest to K2
^KT-64440 Fixed
2024-03-11 15:12:44 +00:00
Igor Yakovlev 8fe5cf2641 [WasmJs] Support catching JS exceptions
Fixed #KT-65660
2024-03-11 14:27:12 +00:00
Bogdan Mukvich c6aac835e5 Update SPDX gradle plugin
* fixes SPDX Gradle plugin to be used with configuration cache
* allows removing output workaround for multimodule builds

KTI-1427
2024-03-11 14:22:06 +00:00
Mikhail Glukhikh 633e96b966 K1/K2: add test for Future.get case 2024-03-11 13:38:05 +00:00
Mikhail Glukhikh f597c02327 K1/K2: extend the test for KT-65184 with the case suggested by Simon 2024-03-11 13:38:05 +00:00
Mikhail Glukhikh 60f9206d3b Fix test data for IR fake override tests 2024-03-11 13:38:05 +00:00
Mikhail Glukhikh 266669272d Rename/move/mark the test for KT-65184 2024-03-11 13:38:05 +00:00
Mikhail Glukhikh 98e4c64360 K1/K2: add more tests around intellij.vcs.git example 2024-03-11 13:38:05 +00:00
Mikhail Glukhikh d04625666a K2: don't approximate captured types in ResultTypeResolver in certain cases
To be more precises, ResultTypeResolver for K2 now searches for
similar LOWER/UPPER constraints pair based on the same flexible type,
like LOWER(CapturedType&Any..CapturedType?) and UPPER(CapturedType!).
If such a pair is found, the CapturedType is not approximated.
This is done to avoid a big difference between this case and
completely same constraints, like LOWER(CapturedType!) and
UPPER(CapturedType!). In this case we squash them to EQUAL(CapturedType!)
even before ResultTypeResolver, and captured types which is got from
an EQUAL constraint are not approximated even before this commit.

This commit fixes back a case from KT-50134 and a problem with intellij.vcs.git

#KT-65596 Fixed
2024-03-11 13:38:05 +00:00
Mikhail Glukhikh c966533d73 K2: reproduce a problem from intellij.vcs.git 2024-03-11 13:38:05 +00:00
Mikhail Glukhikh e701a16460 Fix of jspecify test data
In a1.bar<T?> now we have effectively T! bound instead,
so a diagnostic disappears here
2024-03-11 13:38:05 +00:00
vladislav.grechko 8a6467e524 [FIR] Add tests for KT-65184 to confirm its proper work
#KT-65184 Fixed
2024-03-11 13:38:05 +00:00
Mikhail Glukhikh 78b6432ced K2: don't make T = Type! substitutions for constructors, including SAM
Without this commit we get some ABI changes and it looks bad.

Related to KT-65596
2024-03-11 13:38:05 +00:00
Denis.Zharkov 81414d758d K2: repeat K1 representation for flexible type parameters
This commit changes the behavior of KT-59138 effectively declining it in 2.0.
However, we plan to implement KT-59138 behavior under a feature
flag in 2.0 (see KT-66447), and switch this feature on version 2.x.

Also, this commit implements the LC resolution about postponing
KT-57014 change. We don't have KT-57014 described behavior in 2.0 anymore.
However, we plan to implement a deprecation warning here, see KT-65578.

After this commit, 6 diagnostic tests become incorrectly broken:
- 5 tests from PurelyImplementedCollection group
- a test platformTypes/nullableTypeArgument.kt

This commit also breaks currently fixed-in-k2 KT-50134
(it is fixed again in the following commits),
as well as KT-58933 (it will remain not fixed till we enable KT-59138
behavior again).

#KT-65596 In Progress
#KT-57014 In Progress
#KT-58933 Submitted
2024-03-11 13:38:05 +00:00
Mikhail Glukhikh 7fd46f1450 Minor: remove redundant call 2024-03-11 13:38:05 +00:00
Mikhail Glukhikh 16c116908c Minor: fix typo 2024-03-11 13:38:05 +00:00
Mikhail Glukhikh 65adbeebd9 Minor: drop commented code part 2024-03-11 13:38:05 +00:00
Mikhail Glukhikh db173b8ac5 K1/K2: add test for Comparator.comparing situation from intellij 2024-03-11 13:38:05 +00:00
Mikhail Glukhikh 993509c057 K1/K2: add test for streams situation from intellij 2024-03-11 13:38:05 +00:00
Mikhail Glukhikh 6e1b6427ab K1/K2: add a test confirming current behavior of KT-57014 case 2024-03-11 13:38:05 +00:00
Artem Daugel-Dauge 9e7e44e58f [Native] Add comments for the Xcode 15.3 workaround
^KT-65542
2024-03-11 13:25:40 +00:00
Dmitrii Krasnov 8d7844316b [Gradle] Removed using rootProject from KonanPropertiesBuildService
^KT-64995 Fixed
2024-03-11 12:07:14 +00:00
Alexander Udalov ee506c1369 IR: optimize IrAnnotationContainer.copyAnnotations
Annotation arguments cannot contain declarations, so we can use empty
SymbolRemapper instead of DeepCopySymbolRemapper because the latter
introduces some overhead.

 #KT-66281
2024-03-11 11:49:10 +00:00
Alexander Udalov d5c2aa4c0c IR: rename and move deepCopyWithVariables
Rename it to `deepCopyWithoutPatchingParents`, move to
`org.jetbrains.kotlin.ir.util`, make it inline+reified, and extract the
common implementation with `deepCopyWithSymbols` into `deepCopyImpl`.
2024-03-11 11:49:10 +00:00
Alexander Udalov 1d38c01afc IR: remove some usages of deepCopyWithVariables
At this point, `deepCopyWithVariables` is the same as
`deepCopyWithSymbols` except that the former doesn't call
`patchDeclarationParents`, which most likely produces incorrect IR in
some call sites.
2024-03-11 11:49:10 +00:00
Alexander Udalov e7e8cba1b4 IR: slightly simplify deep copy interface
Do not pass TypeRemapper explicitly unless an instance of something
other than DeepCopyTypeRemapper is required.
2024-03-11 11:49:10 +00:00
Alexander Udalov d659b76de5 IR: remove usages of SymbolRenamer
Its only implementation was DEFAULT so now it's inlined.
2024-03-11 11:49:10 +00:00
Wojciech Litewka be4e81fbce [IR] Avoid subclassing IrGetValue in FunctionInlining
to avoid custom IrElement implementations.

#KT-65773 In Progress
2024-03-11 11:35:48 +00:00
Wojciech Litewka 747b69c6c0 [IR] Avoid subclassing IrFileImpl
to avoid custom IrElement implementations.

#KT-65773 In Progress
2024-03-11 11:35:48 +00:00