Commit Graph

105388 Commits

Author SHA1 Message Date
Dmitrii Gridin ec79d8cd27 [SLC] add multiplatform test cases on typealias actualization
^KT-62345
2023-10-17 17:19:40 +00:00
Dmitrii Gridin 8f0cf3f0cc [SLC] allow multi-module test cases
^KT-62345
2023-10-17 17:19:40 +00:00
Dmitrii Gridin 0771b60777 [Analysis API] support multiplatform test cases
^KT-62345
2023-10-17 17:19:40 +00:00
Alexander Shabalin 83435ccde1 [K/N] Remove workaround in FrameworkTest for old macOS
In macOS prior to 10.14.4 we needed to specify the location of
libswiftCore.dylib. That OS version is long unsupported, so we can
drop the code.
2023-10-17 16:54:34 +00:00
Alexander Shabalin 004ef267c5 [K/N] Remove check for bitcode embedding ^KT-61875
This removes the check in old testing infra for FrameworkTest.
2023-10-17 16:54:34 +00:00
Ilya Gorbunov 406d1eaf89 YarnAndNpmSuppressor: allowed test task names for wasm tests 2023-10-17 16:30:41 +00:00
Ilya Gorbunov 469ca237db Remove the previous approach to build wasm stdlib variants 2023-10-17 16:30:41 +00:00
Ilya Gorbunov d4b245615a Build wasm stdlib artifacts in kotlin-stdlib project 2023-10-17 16:30:41 +00:00
Ilya Gorbunov 53681a33d9 Add required opt-ins in wasm stdlib sources 2023-10-17 16:30:41 +00:00
Ilya Gorbunov 735a97245d Remove forgotten ExperimentalStdlibApi in wasm sources 2023-10-17 16:30:41 +00:00
Ilya Gorbunov db6dfe99a0 Update Dokka to 1.9.10 2023-10-17 15:43:59 +00:00
Sebastian Sellmair ca79860a71 [Gradle] Move 'whenEvaluated' util function into 'utils' package 2023-10-17 13:58:02 +00:00
Sebastian Sellmair 6240e2eddb [Gradle] Rename KotlinMultiplatformPlugin.kt to KotlinLegacyMultiplatformPlugin.kt 2023-10-17 13:58:01 +00:00
Ilya Kirillov 7db2fc522e [Analysis API Standalone] fix builtin resolution for common module
StubBasedBuiltInsSymbolProvider does not work for now for common modules (KT-61757)
 but compiler builtins provider `FirBuiltinSymbolProvider` works.

Also, stub-based symbol providers should not be used in standalone mode.

Testdata from standalone is updated because of the difference
in property accessors (KT-62449) between stub and compiler builtin symbol providers.

Additionally, this commit fixes the behavior of `KotlinStaticPsiDeclarationFromBinaryModuleProvider`.
As compiler builtin declarations have no PSI attached,
`KotlinStaticPsiDeclarationFromBinaryModuleProvider` is used to get PSI
from `DecompiledPsiDeclarationProvider.findPsi`.
`DecompiledPsiDeclarationProvider` is only used in UAST standalone mode.
2023-10-17 13:23:11 +00:00
Evgeniy.Zhelenskiy 5b4731a780 [FIR] Fix local typealias visibility resolution
#KT-60026
2023-10-17 12:48:04 +00:00
Dmitriy Novozhilov 3f89f03b54 [IR Actualizer] Set overridden symbols for property accessors 2023-10-17 12:46:28 +00:00
Dmitriy Novozhilov 8ccbbedbd5 [Test] Update debugger testdata because of KT-62521 2023-10-17 12:46:28 +00:00
Dmitriy Novozhilov 3b6ad36af1 [Test] Update/unmute tests after previous fixes
It's hard to tell which exact commit fixed each test
2023-10-17 12:46:28 +00:00
Dmitriy Novozhilov 84f41b7d68 [FIR] Use lower bound of supertype in findClassRepresentation for intersection types 2023-10-17 12:46:28 +00:00
Dmitriy Novozhilov c3f3a4192c [FIR] Check supertypes hierarchy for java classes during creation of synhtetic properies
^KT-62394 Fixed
2023-10-17 12:46:28 +00:00
Dmitriy Novozhilov 16ab36e167 [FIR] Don't create synthetic overriden property if base property is invisible
^KT-62393 Fixed
2023-10-17 12:46:27 +00:00
Dmitriy Novozhilov 61ec143b74 [FIR] Don't generate delegated members for java methods with default implementation
^KT-62334 Fixed
2023-10-17 12:46:27 +00:00
Dmitriy Novozhilov 5857e6cc5d [Test] Mute some tests because of KT-62393 and KT-62394 2023-10-17 12:46:27 +00:00
Dmitriy Novozhilov 8bf4d3cbf7 [Test] Mute some tests because of KT-62334 2023-10-17 12:46:27 +00:00
Dmitriy Novozhilov 3d6ec0ec75 [FIR2IR] Automatically store IR declaration in its parent upon creation
Previously, creating a declaration with Fir2IrCallableDeclarationsGenerator/
  Fir2IrClassifiersGenerator didn't guarantee that this declaration will
  be actually added to the list of parent class/file declarations, which
  lead to situations when FIR2IR created some declarations in the air
  (mostly fake-overrides)
2023-10-17 12:46:27 +00:00
Dmitriy Novozhilov 22f55b3dc4 [Raw FIR] Keep the name of an anonymous object of enum entry in classId of its nested classes
It is needed to have an ability to distinguish those two cases in FIR2IR:

Without this change the following tests fail:
- org.jetbrains.kotlin.test.runners.codegen.FirPsiBlackBoxCodegenTestGenerated.Enum
  - testEnumEntryReferenceFromInnerClassConstructor1()
  - testEnumEntryReferenceFromInnerClassConstructor2()
  - testEnumEntryReferenceFromInnerClassConstructor3()
  - testInnerClassMethodInEnumEntryClass()
  - testInnerClassMethodInEnumEntryClass2()
  - testKt9711_2()
  - testDeepInnerClassInEnumEntryClass()
  - testKt7257_boundReference1()
  - testInnerClassInEnumEntryClass()
  - testKt44744_innerClass()
2023-10-17 12:46:27 +00:00
Dmitriy Novozhilov 000c24fc69 [Raw FIR] Add test for callable ids of functions inside body of enum entry 2023-10-17 12:46:27 +00:00
Dmitriy Novozhilov 34d0f3dbc2 [FIR2IR] Correctly calculate ir origin for f/o callables in declarations generator
This change uncovers one problem, which causes some MPP tests to fail
This problem will be fixed in further commits

Uncovers KT-62535
2023-10-17 12:46:27 +00:00
Dmitriy Novozhilov 50425e82c5 [FIR2IR] Simplify Fir2IrDeclarationStorage.getIrPropertySymbol
For reasoning refer to the message of the previous commit
It is the same as for `getIrFunctionSymbol`

There is one failing test here, caused by KT-61941
The issue was here before this commit, but it was hidden
2023-10-17 12:46:27 +00:00
Dmitriy Novozhilov 1e090d45d1 [FIR2IR] Simplify Fir2IrDeclarationStorage.getIrConstructorSymbol
For reasoning refer to the message of the previous commit
It is the same as for `getIrFunctionSymbol`
2023-10-17 12:46:27 +00:00
Dmitriy Novozhilov c7c83de528 [FIR2IR] Don't create fake-overrides of static members like they are real ones
It's incorrect to create fake-overrides with `getOrCreateIrFunction/Property`
  call. FakeOverrideGenerator should be used instead. So this commit
  just changes the place which creates static f/o generated from

I failed to reproduce the corresponding failure in compiler tests, but
  without this change FP Kotlin test fails
2023-10-17 12:46:27 +00:00
Dmitriy Novozhilov bb093037c0 [FIR2IR] Simplify Fir2IrDeclarationStorage.getIrFunctionSymbol
Previously `getIrFunctionSymbol` effectively did the same thing as `getOrCreateIrFunction`,
  but in a slightly different way. To avoid logic duplication and source of
  potential inconsistencies, implementation was changed to just delegate to
  `getOrCreateIrFunction`

Changes in `computeIrOrigin` were required because origin for callables in
  `getOrCreateIrFunction` and `getIrFunctionSymbol` was computed differently,
  so `computeIrOrigin` was changed to preserve existing behavior

^KT-60924
2023-10-17 12:46:27 +00:00
Sebastian Sellmair a8e637205c [Gradle] Migrate extraProperties.getOrPut usages to *StoredProperty
KT-61634
2023-10-17 12:10:15 +00:00
Sebastian Sellmair ecbd741e40 [Gradle] Rename stored{Classifier}Property to {classifier}StoredProperty
This change is intended to improve the intuition of developers.
After adding the two functions, many times developers (me) have
tried to use the 'wrong' (which is now the new name) function name.

KT-61634
2023-10-17 12:10:15 +00:00
Sebastian Sellmair 08241acb6f [Gradle] Demote ExtrasProperty APIs with little usage
Those APIs can either be replaced with StoredProperty
Some APIs also have shown to be 'hard to understand'

KT-61634
2023-10-17 12:10:15 +00:00
Vladimir Sukharev 242c1cf5f0 [FIR] Fix disappeared REPEATED_ANNOTATION for dynamic types
https://youtrack.jetbrains.com/issue/KT-59916/K2-Disappeared-REPEATEDANNOTATION
FirAnnotationChecker does not detect repeated annotation on dynamic type, since FirTypeResolverImpl wrongly did not convert source annotations to attributes of ConeDynamicType.
This MR improves FirTypeResolverImpl to convert attributes of FirDynamicTypeRef to annotations and attach them to ConeDynamicType.

Merge-request: KT-MR-12551
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-10-17 10:18:36 +00:00
Ilya Goncharov 22a01432df [Gradle,JS] Remove legacy target in Gradle plugin
This reverts commit 4c82206d

^KT-60694 fixed
2023-10-17 09:42:38 +00:00
Alexander Shabalin 27c85a059f [K/N] Move memmem from Porting.h to KString.cpp ^KT-59008 2023-10-17 09:37:34 +00:00
Dmitrii Gridin d9071aed78 [LL FIR] LLFirAnnotationArgumentsTargetResolver: add missing context for value parameters 2023-10-17 09:30:44 +00:00
Mikhail Glukhikh fd057ac68a FE: Add two more tests around KT-59561 2023-10-17 06:49:38 +00:00
Mikhail Glukhikh 9f6abfc166 K2/MPP: treat Array<Some> & Array<out Some> as similar types in annotations
#KT-59561 Fixed
Related to KT-61100
2023-10-17 06:49:38 +00:00
Mikhail Glukhikh f085d0f660 K2: add reproduction of KT-61100 and KT-59561 2023-10-17 06:49:37 +00:00
Sergej Jaskiewicz 7ab4ca6f51 [IR generator] Inherit Element from AbstractElement
This is a step towards commonizing the code generator between
FIR and IR: KT-61970
2023-10-16 22:56:36 +00:00
Sergej Jaskiewicz f9d17a2d51 [IR generator] Inherit Field from AbstractField
This is a step towards commonizing the code generator between
FIR and IR: KT-61970
2023-10-16 22:56:36 +00:00
Sergej Jaskiewicz 15751333e3 [IR generator] Introduce constants for List-like types 2023-10-16 22:56:36 +00:00
Ilya Goncharov 4e37ac6ed8 [JS] Silent rollup build
^KT-53077 fixed
2023-10-16 21:20:49 +00:00
Alexander Udalov 6219f7fc0d JVM IR: fix detection of enum entries in the same module
Use the new `IrClass.hasEnumEntries` flag added in the previous commit.

 #KT-61208 Fixed
2023-10-16 20:22:20 +00:00
Alexander Udalov c33c918bd4 IR: add IrClass.hasEnumEntries
This flag will be used on JVM to determine whether or not to generate
external enum entries mappings ("$EntriesMappings") classes. Note that
from the frontend's point of view, every enum has `entries`, so for
backend purposes we have to reach out to the underlying deserialized
data to read the flag from the metadata.
2023-10-16 20:22:20 +00:00
Alexander Udalov db31f1f926 Tests: update some backend tests on enum entries
The enumEntriesIntrinsicMultipleEnums.kt test was supposed to check that
JVM backend generates 3 `$EntriesIntrinsicMappings` classes: for X, for
Y, and for Z. Mappings classes are generated for enums without
`entries`, i.e. Kotlin enums compiled without `EnumEntries` language
feature, and Java enums. The test incorrectly _enabled_ the language
feature for X though, and `$EntriesIntrinsicMappings` for X was
generated anyway because of KT-61208.

To keep the original intention of the test, I'm disabling the language
feature for X, so that it will be considered as enum without `entries`.
KT-61208 will be fixed in a separate commit (with separate tests).

The boxInline and bytecodeText tests changed their meaning when language
feature EnumEntries started to be enabled by default, so those changes
are a continuation to ebd43fc8c0. The behavior did not change after
enabling the feature, once again because of KT-61208.

Also, remove obsolete error suppressions which are no longer needed
after 64c8ce18a0.
2023-10-16 20:22:20 +00:00
Roman Golyshev cb65d2420f KTIJ-27139 [AA] Clean-up KtFirReferenceShortener
Unify the code which detects whether qualified expression/type is
actually selected
2023-10-16 20:05:01 +00:00