Commit Graph

104752 Commits

Author SHA1 Message Date
Mikhail Glukhikh 101166c8a7 K2/CLI tests in LV 2.0: drop warnings related to KT-56989 2023-09-19 15:46:27 +00:00
Mikhail Glukhikh 0a498660cb Run K2 scripts in PSI mode 2023-09-19 15:46:27 +00:00
Dmitrii Gridin 11d86992c5 [SLC] update test data for 2.0 version
* disable compiled tests for scripts because they are not supported yet
* fix test data

^KT-60590 Fixed
2023-09-19 15:46:27 +00:00
Mikhail Glukhikh 2a8b655294 Update tests after switching to LV 2.0
Related to KT-59171
2023-09-19 15:46:27 +00:00
Mikhail Glukhikh 5fb38008b7 Switch Kotlin version to 2.0
#KT-59171 In Progress
2023-09-19 15:46:26 +00:00
Sebastian Sellmair 68ca571528 [Gradle] jvm+android: Add additional test for 'java only'
^KT-62033 Verification Pending
2023-09-19 15:31:57 +00:00
Sebastian Sellmair cb5026b528 [Gradle] jvm+android: Support source dependency resolution to jvm only project
^KT-62033 Verification Pending
2023-09-19 15:31:57 +00:00
Konstantin Tskhovrebov 5473db9ac5 KT-56369: [cinterop] Add gradle integration test on '-fmodules' hint 2023-09-19 15:23:52 +00:00
Konstantin Tskhovrebov 4ad5be35f4 KT-56369: [cinterop] Throw an error for an unexpected module imports
Module imports require explicit '-fmodules' compiler flag.
If the indexer meets a module import but there is no the flag
then it throws an error.
2023-09-19 15:23:52 +00:00
Dmitrii Krasnov 8e71488adf [Gradle] Check ~/.konan after each test class
Added deleting ~/.konan before kotlin-gradle-plugin-integration-tests execution. And added checking ~/.konan after each test class. This is necessary to check that in each test konan.data.dir gradle property is set properly
2023-09-19 14:39:25 +00:00
Nikita Bobko b15787bfa8 Fir incorrect usage of AbstractExpectActualCompatibilityChecker.getCallablesCompatibility API
^KT-62027 Fixed

`getCallablesCompatibility` requires parentSubstitutor as a parameter,
but we created a member-level substitutor

`getCallablesCompatibility` will create member-level substitutor itself,
no need to create member-level substitutor on the call site.

IndexOutOfBounds was happening in an attempt of creating member-level
substitutor

I will refactor the `createExpectActualTypeParameterSubstitutor` API in
the following commits later. It will help to avoid problems like that
2023-09-19 14:24:15 +00:00
Dmitrii Gridin 9ff3871a8b [LL FIR] LLFirPhaseUpdater: add missing update for code fragment block 2023-09-19 14:03:29 +00:00
Dmitrii Gridin e5f0356e16 [LL FIR] LLFirPhaseUpdater: add missing update for initializer body 2023-09-19 14:03:29 +00:00
Dmitrii Gridin 12dc6b1ebc [FIR] FirRenderer: render name for scripts
A script name is important information, so it is better to render it.
This also will fix the inconsistency with redundant space after 'SCRIPT:'.
2023-09-19 14:03:29 +00:00
Dmitrii Gridin c6bb9af823 [FIR] FirRenderer: add missing resolvePhaseRenderer usage for anonymous initializer and dangling modifiers 2023-09-19 14:03:29 +00:00
Dmitrii Gridin c9df6aff5f [LL FIR] do not crash on attempt to resolve class initializer in case of class clash
^KT-61788 Fixed
2023-09-19 14:03:29 +00:00
Dmitrii Gridin e3ad946d23 [LL FIR] add more debug info into containingClass
^KT-61788
2023-09-19 14:03:29 +00:00
Brian Norman 4b6c767704 [FIR] Report UNINITIALIZED_VARIABLE for top-level properties
When checking top-level properties, check with initialization enabled.
This makes sure the same errors are reported for member and top-level
properties.
2023-09-19 13:42:54 +00:00
Anton Lakotka 1a35d01fe1 [Gradle] Fix possible CME in sourceSetsMetadataOutputs
Iterating over source sets and waiting for compilation wasn't safe.
 Because compilation upon configuration were able
 to add more source sets.

 Awaiting source sets first should solve the issue.

^KT-61652 Verification Pending
2023-09-19 13:28:51 +00:00
Anton Lakotka 7d047261d9 [Gradle] Test no CME when jupiter plugin is applied
^KT-61652 Verification Pending
2023-09-19 13:28:51 +00:00
Pavel Kunyavskiy 71128e232e [K/N] Avoid creating fake overrides before setting class parent
This fixes a tests crash introduced in #KT-61366 fix.
2023-09-19 12:04:05 +00:00
Roman Efremov c88b4105c5 [K2] Correctly handle case when expect annotation is unresolved
Don't report if annotation has error type.

Review: KT-MR-12250

^KT-62026 Fixed
2023-09-19 10:19:08 +00:00
Roman Efremov 04c1bf749c [K1] Correctly handle case when expect annotation is unresolved
Before change NPE was thrown.

Review: KT-MR-12250

^KT-62026
2023-09-19 10:19:08 +00:00
Alexander Udalov 5cae87b263 K2: add package FQ name to ClassId of anonymous objects
This is needed because in order to figure out which declarations are
visible from anonymous objects in terms of overridability (see
`FirVisibilityChecker.isVisibleForOverriding`), we need to get the
package name of that anonymous object, because there's package-private
visibility on JVM.

 #KT-62017 Fixed
2023-09-19 09:32:55 +00:00
Zalim Bashorov 59a9855373 [Wasm] Use Node.js with canary v8 that supports recent Wasm GC changes
It's required to run wasm stdlib tests and compiler box tests with WASI.

#KT-59720
2023-09-19 09:23:26 +00:00
Zalim Bashorov 8a6fdf2493 [Wasm] Change expected outcome to SUCCESS in wasm-wasi-test
Added workaround for missing dependency.

#KT-59720
2023-09-19 09:23:26 +00:00
Zalim Bashorov c915cc54c7 [Wasm] Use Node.js with "canary" v8 in gradle mpp tests
It's required due to switching to the latest wasm opcodes.

#KT-59720
2023-09-19 09:23:26 +00:00
Zalim Bashorov 86e854a980 Revert "[Wasm] Don't use the new br_on_cast* instructions since they are not supported in Node.js yet"
This reverts commit 2d728727

#KT-60828 Fixed
2023-09-19 09:23:26 +00:00
Zalim Bashorov eecfc2c6d3 [Wasm] Simplify a message printed in case of WebAssembly.CompileError
#KT-59720
2023-09-19 09:23:26 +00:00
Zalim Bashorov 44f9199f66 [Wasm] Update Binaryen to 116
#KT-59720
2023-09-19 09:23:26 +00:00
Zalim Bashorov 48d4bb5261 [Wasm] Temporarily disable running tests on SpiderMonkey
#KT-59720
2023-09-19 09:23:26 +00:00
Zalim Bashorov c71a341a53 [Wasm] Remove no longer needed options for V8
#KT-59720
2023-09-19 09:23:26 +00:00
Zalim Bashorov 874ca6a1af [Wasm] Update v8 to 11.9.85
#KT-59720
2023-09-19 09:23:26 +00:00
Zalim Bashorov 9ec6fea9d5 [Wasm] Update Wasm GC to final codes 🎉
#KT-59720 Fixed
2023-09-19 09:23:26 +00:00
Anton Lakotka 64f0e1e742 [Gradle] registerProjectStructureMetadata in afterEvaluate
To prevent issues with Configuration Cache and Precompiled Script Plugins

^KT-59042 Verification Pending
2023-09-19 08:48:54 +00:00
Anton Lakotka 37d797577b [Gradle] Test MPP with Configuration Cache and Precompiled Script Plugins
^KT-59042 Verification Pending
2023-09-19 08:48:54 +00:00
Sergej Jaskiewicz 314fcc1ad2 [IR generator] Remove unused suppressPrint property 2023-09-19 07:25:30 +00:00
Dmitrii Gridin 5981fb3022 [LL FIR] drop copyright from testData 2023-09-18 21:12:45 +00:00
Dmitrii Gridin 33e6a85a2d [LL FIR] rename testdata to testData to avoid copyright generation
We exclude testData pattern from copyright scope
2023-09-18 21:12:45 +00:00
Pavel Kunyavskiy aef5290210 [K/N] Change test to make aggregate green.
The test is using error suppressing, so breaking it is fine.


^KT-62015
2023-09-18 20:02:36 +00:00
Yan Zhulanow 40ecd4bc1e [fir2ir] Fix annotation conversion on partial module compilation
Backend requires annotation constructors to be fully resolved for the
'IrConst' default value lowering. However, in the IDE there is usually
no need in complete annotation class resolution.

^KTIJ-27061 Fixed
2023-09-18 19:48:08 +00:00
Yan Zhulanow 480bac7537 [fir2ir] Fix conversion of modules with source built-ins
In the Kotlin compiler project, built-in classes are resolved to source
declarations. It's not an issue for usual file analysis in the IDE, as
referenced built-ins are analyzed on demand.

Fir2ir, however, fetches built-in classes at once without checking its
resolution state, breaking code compilation in the IDE.

^KTIJ-27061 Fixed
2023-09-18 19:48:08 +00:00
Yahor Berdnikau ac18f6e16e [Gradle] Fix common sources are not included for kaptGenerateStubs task
^KT-61622 Fixed
2023-09-18 18:52:28 +00:00
Yahor Berdnikau 005e3c0939 [Gradle] Update test verifying MPP/Jvm project is working with Kapt
We have such test, but it was using long deprecated platform plugins.

^KT-61622 In Progress
2023-09-18 18:52:28 +00:00
Dmitriy Dolovov a2e148173d [JS] Don't produce metadata-only (IR-less) KLIBs in JS
The scenario when JS source code is shared between a few JS common
source sets is not supported in Kotlin Multiplatform.

^KT-61136
2023-09-18 17:58:43 +00:00
Vladimir Sukharev 9a2eff6487 [FIR2IR] Don't replace while loop and when branch body blocks with single expression. Skip some empty blocks.
https://youtrack.jetbrains.com/issue/KT-60264/K2-while-loop-body-block-sometimes-replaced-with-single-expression

Merge-request: KT-MR-12035
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-09-18 15:27:19 +00:00
Dmitrii Gridin f4df4f8007 [FIR] do not invoke body resolution for properties with excplicit type on implicit type phase
`property.backingField != null` is too soft condition because currently
each property has a backing field. We should trigger the full body
resolution only in the case of an implicit type on the property or on
the backing field

^KT-61991 Fixed
2023-09-18 15:26:53 +00:00
Dmitriy Novozhilov 97cf240450 [FIR] Reuse enhancement storage during creation of synthetic properies
^KT-61972 Fixed
2023-09-18 15:09:07 +00:00
Jinseong Jeon cec299ac0a K2 UAST: Improve performance of PSI declaration provider
When it comes to finding regular class (of `PsiClass`) from the given
`ClassId`, we've reinvented the wheel in a worse way. `JavaFileManager`
is there to find `PsiClass`, and we already build/populate index for
that while initializing AA standalone mode's own project environment.
We can simply load that manager and send a query, that's it.

However, our efforts so far on binary PSI declaration providers are not
entirely useless. `JavaFileManager` can't handle top-level declarations
and search for all callables/classes in a given package in general. So,
we can still use existing logic for non-ClassId queries. We just need to
cache the intermediate results: fq name to `VirtualFile`s.

To fully utilize the aforementioned cache, we also need to cache an
instance of `KotlinPsiDeclarationProvider`.

Combing these three ideas, now running K2 UAST on a very large module is
"on par", e.g.,
K1:
//tools/adt/idea/android:intellij.android.core_lint_test PASSED in 112.8s
  Stats over 7 runs: max = 112.8s, min = 104.3s, avg = 107.9s, dev = 3.6s
K2 (before):
//tools/adt/idea/android:intellij.android.core_lint_test PASSED in 303.0s
  Stats over 7 runs: max = 303.0s, min = 286.8s, avg = 294.4s, dev = 5.0s
K2 (after):
//tools/adt/idea/android:intellij.android.core_lint_test PASSED in 112.8s
  Stats over 7 runs: max = 112.8s, min = 105.7s, avg = 108.9s, dev = 2.4s
2023-09-18 14:55:11 +00:00
Ilya Goncharov 6a514c3209 [Gradle, Wasm] Binaryen to wasm targets
^KT-62024 fixed
^KT-62025 fixed
2023-09-18 14:42:20 +00:00