Commit Graph

103322 Commits

Author SHA1 Message Date
Nikolay Lunyak 61d2e338a4 [FIR] Prevent compiler crash on lambdas in annotations
^KT-59110 Fixed
2023-08-01 14:58:52 +00:00
Roman Efremov 31f21d8593 [IR] Fix IR expect-actual annotations checker in case when annotation is actual typealias
^KT-60830 Fixed
2023-08-01 14:10:04 +00:00
Roman Efremov 5ed3f308fa Add tests for repeatable annotations on expect-actual declarations
Add tests showing current behavior.

^KT-60670
2023-08-01 14:04:03 +00:00
Kirill Rakhman 2de9480101 [FIR] Report deprecations on typealias constructor calls
Typealias constructor calls are now always wrapped with synthetic
FirConstructorCalls so that the referenced typeAlias can be extracted.
Previously, it was only necessary to map type arguments.

#KT-57780 Fixed
2023-08-01 13:50:22 +00:00
Ilya Goncharov b9e5b8a087 [Gradle, Wasm] Add wasmWasi target, replace wasm target onto wasmJs
KT-60654
2023-08-01 13:11:36 +00:00
Dmitry Savvinov a65953a7fb [Gradle] Minor, rename task
EnsureNoKotlinGradlePluginErrors ->
CheckKotlinGradlePluginConfigurationErrors
2023-08-01 13:03:29 +00:00
Dmitry Savvinov 7cc72f096a [Gradle] Don't use PropertiesProvider.propertiesWithPrefix in checker
It causes weird failures in functional tests, see KT-60712.

Instead, enumerate all known KGP properties and report only them. Note
that internal properties, unknown to the current version of KGP, won't
be reported. Such cases can appear because of a typo or after migrating
to version of KGP that dropped support for that property. It's not
considered to be a problem at the moment
2023-08-01 13:03:29 +00:00
Dmitry Savvinov 34f4e3cbf6 [mpp, tests] Modernize and simplify new-mpp-lib-with-tests
- Don't use presets (they are deprecated and provoke ERROR, causing
  build to fail)
- Drop two JVM targets (cause issues because ambiguous consumable
  configuration will be created; proper setup needs disambiguation
  attribute, but that's too much for this test)
- Drop jvmWithJava-target (this test case is used in several places
  as "just some MPP project", so specific advanced features like
  jvmWithJava shouldn't be covered here)

Refer to KT-60745 for proper jvmWithJava support
2023-08-01 13:03:29 +00:00
Dmitry Savvinov a9a6441d2d [Gradle] Improve tests on diagnostics rendering, suppression, failures 2023-08-01 13:03:29 +00:00
Dmitry Savvinov a132d37292 [Gradle] Introduce checker of 'kotlin.internal' properties
Those properties are meant for internal use and/or "hacking". Using them
by design provokes big non-suppressible warning
2023-08-01 13:03:29 +00:00
Dmitry Savvinov 6c88b92b88 [Gradle] Fail compileKotlin-tasks if ERROR-diagnostics were reported
KT-60237
2023-08-01 13:03:29 +00:00
Dmitry Savvinov c544d68a64 [Gradle] Do not store suppressed diagnostics 2023-08-01 13:03:28 +00:00
Dmitry Savvinov 71c1abde5c [mpp] Minor: use ToolingDiagnostic for reporting cyclic dependsOn-edges 2023-08-01 13:03:28 +00:00
Dmitry Savvinov 7abb0d9f0c [Gradle] Minor: prettify extraction of Tooling diagnostics from output 2023-08-01 13:03:28 +00:00
Alexander Korepanov d0e4515ec1 [JS IR] Materialize all JsCompositeBlock
^KT-60667 Fixed
2023-08-01 12:22:17 +00:00
Artem Kobzar cd840997b1 [K/Wasm] Rework Wasm enumEntriesIntrinsic declaration to fix stdlib compilation 2023-08-01 11:53:14 +00:00
Artem Kobzar 12715c062d [K/JS] Reexport exported declarations in a proxy module file with per-file compilation 2023-08-01 09:42:33 +00:00
Vyacheslav Gerasimov 5ccc302e01 Build: Cleanup verification-metadata.xml
#KTI-1277
2023-08-01 09:18:34 +00:00
Vyacheslav Gerasimov be2875126c Update Dependency verification section in ReadMe.md
#KTI-1277
2023-08-01 09:18:34 +00:00
Vyacheslav Gerasimov be1babeae4 Build: Add protoc to implicitDependencies
#KTI-1277
2023-08-01 09:18:34 +00:00
Vyacheslav Gerasimov 6305d068db Build: Add Android emulators to implicitDependencies
#KTI-1277
2023-08-01 09:18:34 +00:00
Vyacheslav Gerasimov 5be8d63c00 Build: resolve commonCompileClasspath in resolveDependencies task
`commonCompileClasspath` is not resolved during with --write-verification-metadata, only during KGP build

 #KTI-1277
2023-08-01 09:18:34 +00:00
Vyacheslav Gerasimov 58d6e3e57f Build: Download Android x86 emulator image unconditionally
#KTI-1277
2023-08-01 09:18:34 +00:00
Artem Kobzar 08bd0d6ce1 [K/JS] Generate tests for K2 + ES-classes compilation 2023-08-01 09:16:20 +00:00
Alexander Udalov 19653df1c6 IR: minor, fix offset check in IrElement.sourceElement.
There's also SYNTHETIC_OFFSET, which is used for example for
declarations generated by interface delegation, for which
`sourceElement` threw exception. It didn't lead to any user-visible
error AFAIK, I've encountered this problem while working on 5f2ff06296.
2023-08-01 09:13:35 +00:00
Zalim Bashorov 2d728727da [Wasm] Don't use the new br_on_cast* instructions since they are not supported in Node.js yet
#KT-60835 Fixed
2023-08-01 08:46:59 +00:00
Zalim Bashorov c136d0fb5b Revert "[Wasm] Use Node.js with "canary" v8 (11.7.310.0) in tests"
This reverts commit 0bdee00ca2.

#KT-60835
2023-08-01 08:46:59 +00:00
Roman Efremov 3a3b30aef4 Fix mistake in name of test
^KT-58551
2023-08-01 07:08:24 +00:00
Aleksei.Glushko 71b2a22e35 [K/N] Eliminate deadlock on finalizer thread initialization
Merge-request: KT-MR-11388
Merged-by: Alexey Glushko <aleksei.glushko@jetbrains.com>
2023-07-31 21:38:05 +00:00
Dmitriy Dolovov 748eb2f9ee [KLIB] ABI reader: Tests for classes inherited from classes produced by Native interop tool
^KT-54402
2023-07-31 20:22:21 +00:00
Dmitriy Dolovov 32e4b7a76f [KLIB] ABI reader: Show fake overrides for classes inherited from classes produced by Native interop tool
^KT-54402
2023-07-31 20:22:20 +00:00
Dmitriy Dolovov 18668539e9 [KLIB] ABI reader: Tests for DNN & dynamic types
^KT-54402
2023-07-31 20:22:20 +00:00
Dmitriy Dolovov a95f963ad3 [KLIB] ABI reader: Refactor manifest reading test
^KT-54402
2023-07-31 20:22:20 +00:00
Dmitriy Dolovov ac3c000ab1 [KLIB] Native K1 & K2 tests for dumping KLIB ABI
^KT-54402
2023-07-31 20:22:20 +00:00
Dmitriy Dolovov ab9b91180f [KLIB] ABI reader: Expose supported AbiSignatureVersions
^KT-54402
2023-07-31 20:22:20 +00:00
Dmitriy Dolovov ca00c38fca [Native][tests] Use common test tag "klib" for all KLIB-related tests 2023-07-31 20:22:20 +00:00
Dmitriy Dolovov 76e24e5093 [KLIB] JS K1 & K2 tests for API for dumping KLIB ABI
^KT-54402
2023-07-31 20:22:20 +00:00
Dmitriy Dolovov 064600d351 [KLIB] API4ABI: Avoid CCE in HashMap.computeIfAbsent()
^KT-54402
2023-07-31 20:22:20 +00:00
Abduqodiri Qurbonzoda 0f33d71de3 Migrate Vector128 from kotlin.native to kotlinx.cinterop #KT-58402
Make kotlin.native.Vector128 a typealias for kotlinx.cinterop.Vector128
Choose source compatibility over binary compatibility.
2023-07-31 19:38:05 +00:00
Alexander Udalov 2823fff63d K2: report DUPLICATE_CLASS_NAMES error in JVM backend
It was already reported in the K2+PSI mode, but not LT because
BuilderFactoryForDuplicateClassNameDiagnostics relied on PSI, and did
not do anything if PSI was missing.

No tests were added because it fixes the already existing test
`compiler/testData/cli/jvm/fileClassClashMultipleFiles` after the
project is migrated to 2.0.

 #KT-59586
2023-07-31 18:51:00 +00:00
Pavel Mikhailovskii 84bf411cc3 Changes in the compiler needed to run KAPT 4 (KT-51982) 2023-07-31 18:07:40 +00:00
Ivan Kochurkin dac8688a29 [FIR] Report missing TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM for local functions
^KT-59376
^KT-55221 Fixed
2023-07-31 17:38:46 +00:00
aleksandrina-streltsova d9736ec88c [AA] Consider context receivers KtFirCompletionCandidateChecker
^KTIJ-26384 Fixed
2023-07-31 16:37:11 +00:00
Anna Kozlova 8fb9461276 [Fir] get candidate from missed type args diagnostics in annotation call
Otherwise, navigation to unresolved reference is impossible ^ KTIJ-26441

In order to avoid duplicated diagnostic, wrapper is still used.
Symbol collector is updated to retrieve symbols from that wrapper.


Merge-request: KT-MR-11381
Merged-by: Anna Kozlova <Anna.Kozlova@jetbrains.com>
2023-07-31 16:12:17 +00:00
Marco Pennekamp 9c3fa5e878 [LL FIR] KT-58257 Restore invalidation of KtFirAnalysisSession via the project-wide OOBM tracker
- `KtReadActionConfinementLifetimeToken` tracks its validity via the
  project-wide out-of-block modification tracker. Out-of-block
  invalidation of some LL FIR session will cause the lifetime tokens of
  all analysis sessions to become invalid, including unrelated sessions,
  because of this project-wide tracking.
- If `KtFirAnalysisSession`s are only invalidated when their underlying
  LL FIR session is invalidated, the cache may expose analysis sessions
  which contain invalid lifetime tokens after out-of-block modification.
  Even though an analysis session will still be practically valid if its
  underlying LL FIR session is valid, the lifetime token will *think*
  that the PSI has changed and throw an "access to invalid token"
  exception.
- Hence, we cannot currently invalidate `KtFirAnalysisSession`
  granularly and project-wide OOBM tracking needs to be restored.

^KT-60272
2023-07-31 15:58:01 +00:00
Marco Pennekamp 2ba42b8677 [LL FIR] KT-58257 Remove LLFirSession.invalidate
- Due to problematic timing in `LLFirSession.invalidate` when the
  function is called from a read action, it's better to remove the
  function altogether.
- The function's only usage was session invalidation after exceptions
  from resolve when FIR tree guards were turned off. Because FIR tree
  guards are stable enough, the flag that turned them off can be
  removed. This also allows removing `LLFirSession.invalidate`.
- The alternative to removing `LLFirSession.invalidate` would be to
  rewrite session invalidation to be independent of write actions. That
  would require additional locking in `LLFirSessionCache`, which we want
  to avoid.

^KT-59297
2023-07-31 15:58:01 +00:00
Marco Pennekamp 03c8654fe3 [AA] KT-58257 Improve modification event API and documentation
- Module state modification events now have a modification kind, which
  allows adding additional kinds of modification in the future (e.g.
  separating module property and content root updates, if the workspace
  model ever supports it).
  - Splitting off modification kinds was also a good opportunity to
    better document when module state modification occurs.
- Changed the documentation of modification events to be (1) less
  reliant on the IDE implementation and (2) more detailed in the
  intended effect of each event.
- Removed the notion of "stable" modules again and replaced it with
  "libraries". Even though an SDK is technically not a library, the
  term "library modules" should be more friendly to API consumers.
2023-07-31 15:58:01 +00:00
Marco Pennekamp d2b05b8f4f [AA] KT-58257 Restore timing guarantees of module state modification events
- Specifically for non-global module state modification, we can
  guarantee that the event is published before the module is modified.
  This allows subscribers to use the provided `KtModule` without needing
  to fear that the module has already been disposed (in case of
  removal).
2023-07-31 15:58:01 +00:00
Marco Pennekamp 2023c08459 [SLC] KT-58257 Rewrite SLC equality tests to publish global modification events
- `KtFirAnalysisSession` does not need to depend on project out-of-block
  and project root modification trackers anymore, as its underlying
  use-site session determines validity. To ensure that use-site sessions
  are invalidated in SLC equality tests, modification events also need
  to be published.
2023-07-31 15:58:01 +00:00
Marco Pennekamp 7f4af06ac7 [LL FIR] KT-58257 Turn LLFirSession.isValid into a volatile variable
- We do not need `AtomicBoolean` here, because setting `_isValid` to a
  constant `false` suffices.
- Also replace the public setter of `isValid` with `markInvalid` to
  prohibit setting `isValid` to `true` again.
2023-07-31 15:58:01 +00:00