Commit Graph

104490 Commits

Author SHA1 Message Date
Dmitrii Gridin ecb808992d [SLC] add more tests on vararg
^KT-61422
2023-09-11 15:47:47 +00:00
Dmitrii Gridin 3a577e1c31 [Analysis API] add more tests for vararg parameters
^KT-61422
2023-09-11 15:47:47 +00:00
Dmitrii Gridin f1e5a9b223 [FIR builder] create error types for vararg parameters correctly
Otherwise, such types are treated as resolved, but anyway
requires transformation on type phase.
Also, this commit drops the redundant duplicated transformation of
typeReference from primary constructor property generator

^KT-61422
2023-09-11 15:47:47 +00:00
Dmitrii Gridin c0c1966555 [FIR builder] add test for vararg parameter without type
^KT-61422
2023-09-11 15:47:47 +00:00
Kirill Rakhman 2566dabfce [FIR] Report INVISIBLE_REFERENCE on the first unresolved qualifier
#KT-61719 Fixed
2023-09-11 14:23:55 +00:00
Nikita Bobko 2127b2ce68 expect/actual classes: experimental -> Beta
KT-61573
^KT-61712 Fixed
Review: https://jetbrains.team/p/kt/reviews/12044/files

It's a follow up commit

According our guidelines, it must be in Beta
https://kotlinlang.org/docs/components-stability.html#stability-of-subcomponents

And the whole multiplatform was in Beta, so we can't make part of the
multiplatform to have lower stability level
2023-09-11 13:57:28 +00:00
Svyatoslav Scherbina 0cd91d9286 Native: fix filecheck_signext_zeroext_objc_export and enable it back
Previously filecheck_signext_zeroext_objc_export test was disabled
after making one-stage compilation mode implemented through two-stage
mode (KT-59245).

That change made the compiler sort the methods, and filecheck patterns
didn't match that order after that.

This commit fixes the test by adding sorted prefixes to method names,
so sorting alphabetically them doesn't really change the order.
2023-09-11 13:49:36 +00:00
Svyatoslav Scherbina f77f83e741 Native: fix support for cross-target filecheck tests
There was a minor mistake in the build script configuration, leading to
a missing task dependency when running the tests with
`-Pkotlin.native.home=`.

More specifically, the build script was checking if the cross-dist for
the main tests target (`-PtestTarget=`) is in place, but instead it
should have checked if the cross-dist for the test cross-target
(`test.targetName`) is in place.

This commit fixes the check, and thus adds the missing task dependency.
2023-09-11 13:49:35 +00:00
Ivan Kylchik 5d88a1f1c3 [Native] Rename Lowerings to NativeLoweringPhases
This is done to unify the way how we name file
that contains lowerings in different backends.
2023-09-11 10:04:50 +00:00
Ivan Kylchik 386d69018d [JVM] Rename JvmLower to JvmLoweringPhases
This is done to unify the way how we name file
that contains lowerings in different backends.
2023-09-11 10:04:50 +00:00
Kirill Rakhman 16ae83bde0 [FIR] Fix Java sealed class inheritors
This fixes NO_ELSE_IN_WHEN diagnostics when using java sealed
classes in an exhaustive when.

#KT-58216 Fixed
2023-09-11 07:37:37 +00:00
Aleksei.Glushko 6405a174e2 [K/N] Do not CAS when marking newly allocated object
Merge-request: KT-MR-12038
Merged-by: Alexey Glushko <aleksei.glushko@jetbrains.com>
2023-09-09 12:42:54 +00:00
Alexander Shabalin 2f22b0a6b0 [K/N] Migrate runtime/atomics tests to new testing infra ^KT-61259 2023-09-09 07:25:35 +00:00
Abduqodiri Qurbonzoda ba374bb45c Optimize hex formatting and parsing implementation #KT-58218
Merge-request: KT-MR-11702
Merged-by: Abduqodiri Qurbonzoda <abduqodiri.qurbonzoda@jetbrains.com>
2023-09-08 22:40:56 +00:00
Alexander Shabalin eb0a301a8f [K/N] Update CallsChecker list 2023-09-08 17:13:00 +00:00
Alexander Shabalin 6b6da5b08f [K/N] In executors make sure child process does not leak. 2023-09-08 16:22:52 +00:00
Mikhail Glukhikh 20cb075e56 K2: fix calculating property reference type in delegated setter
This commit is an accidentally forgotten part of the KT-61045 fix
#KT-61720 Fixed
2023-09-08 15:35:10 +00:00
Dmitry Savvinov 5736201e3a [K1, MPP] Implement hack for KTIJ-24195
Force-refine typealiases if their expansion isn't visible in the
refiner's module

^KTIJ-24195
2023-09-08 15:31:22 +00:00
Roman Golyshev 370a6fb461 KT-61728 [LL API] Add extra test for smartcast inside let 2023-09-08 14:41:39 +00:00
Roman Golyshev a20dea1b0a KT-61728 [LL API] Ignore CFG nodes with uninitialized flow
This is done until the KT-61794 is fixed
2023-09-08 14:41:39 +00:00
Roman Golyshev 23363ef1bd KT-61728 [LL API] Use ContextCollector in AllCandidatesResolver
Fix testdata for builder inference test in resolve tests - now it's the
same between K1 and K2
2023-09-08 14:41:39 +00:00
Alexander Shabalin ce371df5f6 [K/N] Set 2 minute timeout for StdlibTest 2023-09-08 14:01:43 +00:00
Alexander Shabalin ff88c76e3c [K/N] Parse duration for EXECUTION_TIMEOUT 2023-09-08 14:01:43 +00:00
Mikhail Glukhikh b0b6a6a05a K1/K2: deduplicate/simplify the code around JVM CLI
Related to KT-61510, KT-61745
2023-09-08 13:20:47 +00:00
Mikhail Glukhikh 3561054998 K1/K2: partially share code for multi-module chunks building
#KT-61510 Fixed
Related to KT-61716
2023-09-08 13:20:47 +00:00
Johan Bay a1c2ded8a3 [K/N] Header klibs: Keep private properties in value classes
^KT-61767 Fixed
2023-09-08 13:13:19 +00:00
Alexander.Likhachev 64fb36deef [Gradle] Move konan.data.dir for tests into <repo>/build and normalize the path
This should solve the problem on Windows CI with too long paths in Kotlin/Native integration tests
2023-09-08 13:04:29 +00:00
Alexander.Likhachev c33f7a4161 [Build] Disable ScriptingIT on Windows CI using @OsCondition
`@DisabledOnOs` doesn't propagate its effect to the inheritors
2023-09-08 13:04:29 +00:00
Vladimir Sukharev 3e2c662b6b [FIR] Add testcases to throw class with unresolved parent.
^KT-60048 Fixed
2023-09-08 11:40:35 +00:00
Vladimir Sukharev 69b2e2c0ba [FIR] Don't diagnose MISSING_EXCEPTION_IN_THROWS_ON_SUSPEND in presence of unresolved class
^KT-60048 Fixed
2023-09-08 11:40:35 +00:00
Marco Pennekamp 3fa2ca7ddd [AA] Add specific implementation for KtFirEnumEntryInitializerSymbol
- Previously, `KtFirAnonymousObjectSymbol` was a
  `KtEnumEntryInitializerSymbol`, which carried the risk that an
  anonymous object unrelated to enum entries might be used as an enum
  entry initializer. This commit introduces a specific symbol for FIR
  enum entry initializers.
- As a nice side effect, anonymous object symbol creation is simplified
  and `KtFirEnumEntryInitializerSymbolPointer` can restore the symbol
  via `KtFirEnumEntrySymbol.enumEntryInitializer`.

^KT-61425
2023-09-08 11:13:28 +00:00
Marco Pennekamp 536e172d0e [AA] Add declared member scope tests for enum entry initializers
^KT-61425
2023-09-08 11:13:28 +00:00
Marco Pennekamp 72de86a8ba [AA] Add tests for enum class member scopes
^KT-61405
2023-09-08 11:13:28 +00:00
Marco Pennekamp 3aefeb0fc5 [AA] Add tests for enum entry initializer member scopes
^KT-61425
2023-09-08 11:13:28 +00:00
Marco Pennekamp 3add7f9db5 [AA] Support enum entry initializers in member scope tests
- Now that the enum entry initializer provides a member scope, not the
  enum entry, we need a way to get to the enum entry initializer in
  tests. This can only be done via the enum entry's name, because the
  initializer is anonymous.

^KT-61425
2023-09-08 11:13:28 +00:00
Marco Pennekamp 80efa34926 [AA] Add KtEnumEntryInitializerSymbol
- An enum entry's body is an initializer with members only accessible
  within that body. Because users of the Analysis API might want to
  analyze the members of the enum entry initializer, we expose this
  initializer via `KtEnumEntrySymbol`. The initializer only exists if
  the enum entry has a body.
  - We already have some usages of the initializer inside symbol light
    classes, which generate a light class for each enum entry, which
    includes the enum entry's hidden members.
- To hide the implementation detail that initializers are anonymous
  objects, `KtEnumEntryInitializerSymbol` is simply a
  `KtSymbolWithMembers`.
- The advantage of making it a `KtSymbolWithMembers`, instead of
  providing a custom way to get a member scope, is that we can pass
  around the initializer easily, e.g. in `KtEnumEntrySymbolRenderer`.
- We implement `KtEnumEntryInitializerSymbol` directly as a
  `KtFirAnonymousObjectSymbol` without a wrapper. This has a few
  advantages:
  1. We can directly benefit from the anonymous object symbol being a
     `KtSymbolWithMembers`, so we don't have to handle enum entry
     initializers specially in e.g. `KtFirScopeProvider`.
  2. We don't have to implement a new symbol restoration mechanism for
     the initializer.
  3. This implementation matches the actual FIR tree structure (with a
     simplification that the connecting anonymous object expression
     between the enum entry and the initializing anonymous object is
     omitted).

^KT-61425 fixed
2023-09-08 11:13:28 +00:00
Marco Pennekamp e72a38dc82 [AA] Remove KtSymbolWithMembers from KtEnumEntrySymbol
- An enum entry is a variable which doesn't declare any additional
  members. It must not be confused with its implementing anonymous
  object initializer, which may declare additional members, but is an
  implementation detail hidden outside the enum entry's initializer.
  Hence, the enum entry variable should not have a (declared) member
  scope.
- A following commit will add the ability to get the enum entry's
  initializer, so that a member scope for this initializer can be
  obtained (which might be relevant for local analysis).

^KT-61405 fixed
2023-09-08 11:13:28 +00:00
Marco Pennekamp f64cc184f4 [FIR] Refactoring: Introduce base implementations for delegating scopes
- The implementations of some FIR scopes contain a significant amount of
  delegation to some original scope. This pollutes the implementation of
  such scopes and makes them harder to read.
  `FirDelegatingContainingNamesAwareScope` and `FirDelegatingTypeScope`
  can be used as base classes which delegate by default.
2023-09-08 11:13:28 +00:00
Nikita Bobko 3c73331821 KMP: Put "prohibit actual typealias to special annotations" under the flag
^KT-61668 Fixed

Review: https://jetbrains.team/p/kt/reviews/12062/timeline
2023-09-08 10:51:43 +00:00
Nikita Bobko e742d43ee0 KMP: Put "prohibit expect/actual tailrec/external" under the flag
^KT-61668 Fixed

Review: https://jetbrains.team/p/kt/reviews/12062/timeline
2023-09-08 10:51:43 +00:00
Nikita Bobko 172c04c96a KMP: Put "prohibit expect actual OptIn annotations" under the flag
^KT-61668 Fixed

Review: https://jetbrains.team/p/kt/reviews/12062/timeline
2023-09-08 10:51:43 +00:00
Nikita Bobko 0922833b46 KMP: Put "prohbit actual typealias to Nothing and Nullable" under the flag
^KT-61668 Fixed

Review: https://jetbrains.team/p/kt/reviews/12062/timeline
2023-09-08 10:51:42 +00:00
Nikita Bobko 141bc9cac9 KMP: Put "prohbit actual typealias if expect has default params" under the flag
^KT-61668 Fixed

Review: https://jetbrains.team/p/kt/reviews/12062/timeline
2023-09-08 10:51:42 +00:00
Nikita Bobko 6868c95263 KMP: Put "prohbit expect/actual different annotations" under the flag
^KT-61668 Fixed

Review: https://jetbrains.team/p/kt/reviews/12062/timeline
2023-09-08 10:51:42 +00:00
Nikita Bobko 3a0c4d1087 KMP: Put "prohbit implicit Java actualization" under the flag
^KT-61668 Fixed

Review: https://jetbrains.team/p/kt/reviews/12062/timeline
2023-09-08 10:51:42 +00:00
Nikita Bobko 7667b36aa0 KMP: Put "prohibit member scope mismatch for non-final expect" under the flag
^KT-61668 Fixed

Review: https://jetbrains.team/p/kt/reviews/12062/timeline
2023-09-08 10:51:42 +00:00
Alexander Korepanov 238344758b [FIR] Fix the inability to retrieve an annotation argument
Fix an issue where an inherited @JsName from
another module was not accessible in a child class.

The issue can only be reproduced in the codegen box tests
and cannot be reproduced in the FIR FE checker tests.
2023-09-08 09:55:25 +00:00
Alexander Korepanov ea9e2eb41a [FIR JS] Add more tests for JS_NAME_CLASH and JS_FAKE_NAME_CLASH
^KT-59425 Related
^KT-59370 Related
2023-09-08 09:55:25 +00:00
Alexander Korepanov 6bb939c6cb [FIR JS] Support JS_NAME_CLASH and JS_FAKE_NAME_CLASH diagnostics
^KT-59425 Fixed
^KT-59370 Fixed
2023-09-08 09:55:25 +00:00
Alexander Korepanov 5ac277d058 [FIR JS] Generate diagnostic componentss for JS FIR FE checks
Generate components for JS_NAME_CLASH and JS_FAKE_NAME_CLASH

^KT-59425 Related
^KT-59370 Related
2023-09-08 09:55:25 +00:00