Commit Graph

105494 Commits

Author SHA1 Message Date
Dmitriy Novozhilov 7ff2fc9dbe Add workaround for KT-62702 2023-10-19 12:13:46 +00:00
Dmitriy Novozhilov 866fbed388 Advance bootstrap to 2.0.0-dev-5387 2023-10-19 12:13:45 +00:00
Pavel Punegov ff89fb8405 [K/N][build] Lazy task configuration in the tests 2023-10-19 12:12:02 +00:00
Pavel Punegov e01cea6669 [K/N][build] Add providers to klib install and cache tasks 2023-10-19 12:12:02 +00:00
Pavel Punegov b1a85d45c6 [K/N][build] Move old Konan plugin to native-build-tools 2023-10-19 12:12:02 +00:00
Sergej Jaskiewicz 04c5ac0eb6 [FIR/IR generator] Factor out adding pure abstract element as parent 2023-10-19 12:00:25 +00:00
Sergej Jaskiewicz 5798021e4b [FIR/IR generator] Refactor element parents
- Move `elementParents` and `otherParents` properties
  to `AbstractElement`
- Use `elementParents` instead of `parentRefs` where needed
2023-10-19 12:00:25 +00:00
Pavel Kunyavskiy 33994d419d [IR] Replace a couple of TODOs with shouldNotBeCalled 2023-10-19 10:16:45 +00:00
Pavel Kunyavskiy da488f513f [IR] Fix file modules after actualization
When files from different IrModules are merged in IrActualizer
their IrModule link was not updated. This led to assuming them
as different modules, and incorrect internal visibility handling.

^KT-62623
2023-10-19 10:16:45 +00:00
Pavel Kunyavskiy ad5831acc6 [IR] Add a method to get ModuleDescriptor from IrPackageFragment
Ideally, instead of this method, there should be a link
to IrModuleFragment. Unfortunately, it would require to big refactoring,
as some of IrPackageFragment implementations doesn't have any
IrModuleFragment inside, and are not located inside any
IrModuleFragment.

So for now, we just implement and use everywhere a single way of
getting the module descriptor, which respects a IrModuleFragment
link if it exists, and fallbacks to descriptor-based method
if it doesn't.

^KT-62623
2023-10-19 10:16:44 +00:00
Vladimir Sukharev 9b9ddb760a [FIR2IR] Coerce last operator in a loop to Unit
One of many fixes for https://youtrack.jetbrains.com/issue/KT-59781/K2-investigate-implicit-cast-generation-in-fir2ir-vs-psi2ir

Merge-request: KT-MR-12629
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-10-19 09:53:46 +00:00
Ilya Goncharov 5df8ac4d1a [Gradle, JS] Ignore stdout for mocha dry run
^KT-61992 fixed
2023-10-19 09:46:01 +00:00
Nikolay Lunyak a68a2409d3 [FIR] Remove the applicability filtering when reporting diagnostics
In case we don't want to introduce any new
abstractions like "user relevance for
applicability", we can just remove the
filtering.

^KT-62541 Fixed
2023-10-19 09:27:45 +00:00
Nikolay Lunyak fedadfb8db [FIR] Show ARGUMENTS_MAPPING_ERROR diagnostics along with INAPPLICABLE
K1 reports `ARGUMENT_TYPE_MISMATCH`
and `TOO_MANY_ARGUMENTS` together, and
one way to do it in K2 is to say that
their kinds of inapplicability difference
is not relevant to the user.

Note that K1 doesn't do such filtering,
so this change "makes K2 closer to K1",
but still different.

^KT-62541 Fixed

fixup! [FIR] Show ARGUMENTS_MAPPING_ERROR diagnostics along with INAPPLICABLE
2023-10-19 09:27:45 +00:00
Nikolay Lunyak 06b3c6ec13 [FIR] Reproduce KT-62541 2023-10-19 09:27:44 +00:00
Igor Chevdar 40e8552a8d [gradle] Added a bunch of Gradle IT on K/N incremental compilation 2023-10-19 07:57:36 +00:00
Mads Ager 4e66881549 [Native] Move remaining usages for LLVMBuildLoad to LLVMBuildLoad2.
Step towards LLVM opaque pointers.
2023-10-19 07:54:30 +00:00
Mads Ager 67c501e0b6 [Native] Fix tailrec test.
tailrec is no longer allowed on open functions but this test is
still using it.
2023-10-19 07:54:30 +00:00
Mads Ager a487ec1889 [Native] Use LLVMBuildLoad2 instead of LLVMBuildLoad.
This is a first step in the move from typed to opaque pointers.
2023-10-19 07:54:30 +00:00
Dmitriy Novozhilov 847442d547 [Test] Add regression test for KT-60876 2023-10-19 06:58:14 +00:00
Ilya Gorbunov aedc704e77 [stdlib] Further merge js-ir specific sources 2023-10-19 03:11:54 +00:00
Ilya Gorbunov 911fa3bbbb [stdlib] Merge js-ir specific sources into common js sources 2023-10-19 03:11:54 +00:00
Ilya Gorbunov f00d4022c4 [stdlib] Use common js sources in js-ir compilation without copying 2023-10-19 03:11:54 +00:00
Ilya Gorbunov 3622ea2e33 [stdlib-gen] Minor refactoring: use enum entries instead of values 2023-10-19 03:11:54 +00:00
Ilya Gorbunov ff2254db69 [stdlib] Remove generator templates for js legacy 2023-10-19 03:11:53 +00:00
Ilya Gorbunov 1d232c69d6 [stdlib] Move location of generated sources for js-IR compilation 2023-10-19 03:11:53 +00:00
Ilya Gorbunov 5f0a930ea3 [stdlib] Delete js-v1 sources 2023-10-19 03:11:53 +00:00
Roman Efremov 601c517887 [FIR] Don't print function's default value parameters
...in `ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT` diagnostic message.

^KT-62585
2023-10-18 20:01:47 +00:00
Roman Efremov 0f0540cda0 [Test] Add test for reporting of function default value parameters
...in `ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT` diagnostic message.

^KT-62585
2023-10-18 20:01:47 +00:00
Roman Efremov 7893624589 [FIR] Remove debug labels in annotation arguments rendering
...in `ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT` diagnostic message.

^KT-62585
2023-10-18 20:01:47 +00:00
Roman Efremov f54a1b5ced [FIR] Refactor: extract resolved qualifier rendering out of FirRenderer
^KT-62585
2023-10-18 20:01:47 +00:00
Roman Efremov 6b1e340364 [FIR] Refactor: extract resolved named reference rendering out of FirRenderer
^KT-62585
2023-10-18 20:01:47 +00:00
Roman Efremov 37a0dd9487 [FIR] Use idRenderer to print referenced class and callable ids
...in `ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT` diagnostic message.
Unlike in previous commit, this can't be fixed right in
`FirSymbolRenderer`, because `ConeIdRendererForDebugging` renders
differently and a lot of lazy resolve tests rely on that.

^KT-62585
2023-10-18 20:01:47 +00:00
Roman Efremov 7f7801a7bc [FIR] Use idRenderer to render ClassId in qualifiers
It shouldn't break existing usages, because
1) default `ConeIdRendererForDebugging` renders ClassId in
same way as before the change;
2) I didn't find any usages, which use non-default idRenderer,
but rely on full ClassId be rendered for qualifiers.

^KT-62585
2023-10-18 20:01:47 +00:00
Roman Efremov cb6ec46de1 [FIR] Fix type annotation arguments rendering inside symbols
...in ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT diagnostic.

^KT-62585
2023-10-18 20:01:47 +00:00
Roman Efremov b3467353b2 [Test] Add test for ugly K2 reporting of annotation arguments
...in `ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT` diagnostic message.

^KT-62585
2023-10-18 20:01:47 +00:00
Ilya Kirillov 67ac985be7 [Analysis API Standalone] fix testdata for standalone mode tests
The commit (7db2fc522e) with changing behavior of builtin symbol provider
is in a conflict with a commit (72de86a8ba) where new tests were added.

The difference should be fixed as a part of KT-62651
2023-10-18 19:50:44 +00:00
vladislav.grechko 897eab6b50 Do not add nullability annotations to the methods of local classes
Nullability annotations are useless for the methods of local classes
due to their restricted scope.

^KT-62513: Fixed
2023-10-18 19:48:38 +00:00
Sergej Jaskiewicz 417aa236fb [FIR/IR generator] Factor out printing the preamble in generated files 2023-10-18 18:42:40 +00:00
strangepleasures a33da2a1c6 Temporarily disable Kapt4IT and KaptIncrementalIT and the descendants.
Those tests are currently producing OOMs on Windows
2023-10-18 17:40:29 +00:00
Hung Nguyen 5ceebec331 Cache Gradle properties with a BuildService to improve performance
Currently, the performance overhead when loading a Gradle property
consists of:
  1. Creating a Provider
  2. Resolving the Provider

Both steps are performed even when the same property was loaded before.
That means this overhead will multiply when there are a large number of
property read requests (e.g., in KT-62496, the tested project 400,000
read requests for only 17 properties).

To improve performance, we will now cache both steps with a
BuildService.

With this commit, configuration time for the tested project returns to
the same level before commit d6becee where the performance regression
happened (that commit can't be reverted because it introduced
`Provider`s which are required for proper Gradle usage).

Test: Manually verified on the large project in KT-62496

^KT-62496 Fixed
2023-10-18 17:27:32 +00:00
Svyatoslav Scherbina 141f2e3234 Bump Kotlin/Native version in KGP to 2.0.0-dev-5387 2023-10-18 15:27:08 +00:00
Artem Kobzar d625d9a988 [K/JS] Fix ES6-classes compilation for objects without constructor generated by plugins 2023-10-18 13:29:15 +00:00
Nikolay Lunyak ba9baa7457 [FIR] Don't enable features without sinceKotlin in Progressive Mode
There are two BUG_FIX features that have
been added to the compiler, without a clear
decision to enable them somewhere in the
future. Since there is no decision to
force users rewrite their code, such
features should not be enabled in
Progressive Mode.

^KT-62644 Fixed
^KT-62143 Fixed
2023-10-18 13:16:10 +00:00
Dmitriy Novozhilov 9366847e96 [FIR2IR] Properly approximate intersection types during fir2ir conversion
^KT-62544 Fixed
2023-10-18 13:02:11 +00:00
Sergej Jaskiewicz 8c6da9fddb [FIR/IR generator] Deduplicate interface/abstract class configuration 2023-10-18 12:39:39 +00:00
Alejandro Serrano Mena b231e69cd3 Remove unneeded K1/K2 split in test 2023-10-18 12:34:58 +00:00
Alejandro Serrano Mena b9b15cba08 [K2] Warn about deprecation and opt-in markers for overrides of Any
^KT-62620 Fixed

Include opt-in markers in the diagnostics
2023-10-18 12:34:58 +00:00
Sebastian Sellmair 6afe716238 [Gradle] Implement CustomizeKotlinDependenciesSetupAction
KT-61634
2023-10-18 12:22:09 +00:00
Sebastian Sellmair eba13b5b91 [Gradle] KotlinSingleTargetExtension: Implement lateinit target as Future
It is not obvious from 'KotlinSingleTargetExtension' that calling
into 'target' is unsafe and it might throw.

Ordering code (especially with Android) is hard:
It is not clear when the target will become available.

The Future (and forAllTargets implementation) is intended
to make working with targets generically more safe.

KT-61634
2023-10-18 12:22:08 +00:00