Commit Graph

109783 Commits

Author SHA1 Message Date
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
Wojciech Litewka 1c17219a7b [IR] Mark IrConstructorCall as AnnotationMarker
IrConstructorCall is already used to represent both regular constructor
call and annotations.
Implementing AnnotationMarker avoids 'casting' it to this type later on
 in IrTypeSystemContext, which was done with
 a new IrElement implementation. We'd like to
 avoid such implementations, e.g. as so to make the IR hierarchy sealed.

#KT-65773 In Progress
2024-03-11 11:35:48 +00:00
Artem Daugel-Dauge bfbc33e3f6 [Gradle] Fix macOS functionalTests 2024-03-11 09:09:10 +00:00
Wojciech Litewka e9005e4fed [IR] Initialize IrFunction.returnType eagerly, when possible 2024-03-11 09:07:54 +00:00
Wojciech Litewka 392fa8f9bd [IR] Drop ReturnTypeIsNotInitializedException
It was unused since commit a005f2e75d.
2024-03-11 09:07:54 +00:00
Wojciech Litewka a53ba8a47b [IR] Drop IrUninitializedType
#KT-66053 Fixed
2024-03-11 09:07:54 +00:00
Wojciech Litewka d1e8016ab2 [IR] Pass null instead of IrUninitializedType to IrFactory
#KT-66053 In progress
2024-03-11 09:07:54 +00:00
Timofey Solonin 1a4eaf796d Make resources configuration lenient
This prevents resolution failures if resources configuration ends up
selecting java-api variants

^KT-66393
2024-03-11 09:05:35 +00:00
Timofey Solonin 947d4c57e7 Reproduce resources resolution failure with legacy stdlib in dependencies
Sometimes native variants might depend on java-api dependencies.
Resources configuration doesn't have compatibility rules for these and fails to resolve them.

^KT-66393
2024-03-11 09:05:35 +00:00
Timofey Solonin f813ca1975 Allow js target resources publication
^KT-65540
2024-03-11 09:04:25 +00:00
Timofey Solonin 76814a8bbe Test expected js target resources publication bahavior
^KT-65540
2024-03-11 09:04:25 +00:00
Roman Golyshev b765cf3f99 KT-66411 [AA] Add fake source kind for single expression block around array assignments
A wrapper block was introduced as a part of fixing KT-59748, but was
assigned a real source, which had `getOrBuildFir` confused because
of the incorrectly built `KtToFirMapping`

It is relevant for:
- `if`, `when` expressions with an assignment as a single expression
- Kotlin code fragments,
when the assignment is being analysed as a single expression
in the fragment

^KT-66411 Fixed
2024-03-10 15:35:47 +00:00
Roman Golyshev ec06654a73 KT-66411 [AA] Add test for the getOrBuildFir on array assignment expression as a single when/if branch expression 2024-03-10 15:35:47 +00:00
Roman Golyshev 83a80a45a9 KT-66411 [AA] Add more tests for resolving compound set operators 2024-03-10 15:35:47 +00:00
Igor Yakovlev 324d079111 [WasmJs] Prohibit external classes to be a storage of an associated objects
Fix #KT-65355
2024-03-09 10:40:46 +01:00
Igor Yakovlev 6930fc8fed [WasmJs] Add support for external class reflection
Fix #KT-64890
2024-03-09 10:40:46 +01:00
Alexander.Likhachev e302420197 [BTA tests] Use arbitrary named versions instead of just numbered ones
^KT-61860 In Progress
2024-03-09 01:36:22 +00:00
Alexander.Likhachev bc85375a1e [BTA tests] Provide an optimized way for making exact log line assertions
^KT-61860 In Progress
2024-03-09 01:36:22 +00:00
Alexander.Likhachev 95b832fa8b [BTA tests] Add createFile overload for versioned source creation
^KT-61860 In Progress
2024-03-09 01:36:22 +00:00
Alexander.Likhachev d3c3e0faad Update dependency verification metadata 2024-03-09 01:36:22 +00:00
Alexander.Likhachev f319ff2c3c [BTA tests] Improve README.md
^KT-61860 In Progress
2024-03-09 01:36:22 +00:00
Alexander.Likhachev ea3d5371ef [BTA tests] Add changeFile overload for versioned source modification
^KT-61860 In Progress
2024-03-09 01:36:22 +00:00
Alexander.Likhachev 68cf1bdc57 [BTA tests] Use explicit output assertions instead of implicit ones
^KT-61860 In Progress
2024-03-09 01:36:22 +00:00
Alexander.Likhachev 4facf5ffbc [BTA tests] Move GlobalCompiledProjectsCache to a separate file
^KT-61860 In Progress
2024-03-09 01:36:22 +00:00