Commit Graph

105409 Commits

Author SHA1 Message Date
Dmitriy Novozhilov 704e2ef5c5 Suppress K2 specific warnings in the codebase
^KT-62472
2023-10-18 07:59:27 +00:00
Dmitriy Novozhilov 9e66a7b999 Workaround KT-62473 in the codebase 2023-10-18 07:59:27 +00:00
Dmitriy Novozhilov 6114e4f068 Fix compilation problems caused by migration to 2.0 2023-10-18 07:59:27 +00:00
Dmitriy Novozhilov a35f2eb90e Build: switch language level for compilation to 2.0
KT-61951
2023-10-18 07:59:26 +00:00
Sebastian Sellmair 5642f2a8c4 [build] acceptAndroidSdkLicenses, functionalTest: Support Gradle configuration cache 2023-10-18 07:51:17 +00:00
Anton Lakotka d090791e40 [Gradle] Change rootOutputDirectoryProperty to be DirectoryProperty
^KT-61359 Verification Pending
2023-10-18 04:50:47 +00:00
Anton Lakotka d74a1133e9 [Gradle] Merge testCommonizer and testCleanCommonizationWithConfigurationCache
They are essentially testing the same thing. So it is logical
to merge them into single test run.

^KT-61359 Verification Pending
2023-10-18 04:50:47 +00:00
Anton Lakotka 251f52586e [Gradle] Add fileProperty(initialValue: File) utility function
^KT-61359 Verification Pending
2023-10-18 04:50:47 +00:00
Anton Lakotka 6ee4cbb6ec [Gradle, Test] Let resolveAllConfiguration depend on commonizeNativeDistribution
after introducing changes as part of KT-61359

^KT-61359 Verification Pending
2023-10-18 04:50:47 +00:00
Anton Lakotka c08fb1cae6 [Gradle] add rootOutputDirectoryProperty to NativeDistributionCommonizerTask
And read commonized klibs in execution time only.
it is possible only when rootOutputDirectoryProperty is marked as
OutputDirectory.

```kotlin
class Producer {
  @get:OutputDirectory
  val foo: RegularFileProperty

  @get:Internal
  val bar: RegularFileProperty
}

val foo = producer.flatMap { it.foo.map { it.listFiles() } }
val bar = producer.flatMap { it.bar.map { it.listFiles() } }
```

`foo` file collection will be evaluated at execution time.
Because `Producer.foo` is an OutputDirectory and its content unknown
during configuration time.
But `bar` file collection will be evaluated at configuration time.
Because according to gradle model it is not Output and therefore
its content can be evaluated before task execution.

^KT-61359 Verification Pending
2023-10-18 04:50:47 +00:00
Anton Lakotka 2111bfae40 [Gradle] Test commonizeNativeDistribution task is not initialized
^KT-61359 In Progress
2023-10-18 04:50:47 +00:00
Anton Lakotka e16f03fc49 [Gradle] Test commonize native distribution and compile task with GCC
It should be possible to commonize native distribution from clean state
and compile shared native code in the same gradle build with enabled
configuration cache.

^KT-61359 In Progress
2023-10-18 04:50:47 +00:00
Anton Lakotka 657dd31493 [Gradle] Remove up-to-date checks in CleanNativeDistributionCommonizer
Gradle doesn't track removed files in OutputDirectory after task
execution. So if task removed some files and if these files
are added back the task would be still UP-TO-DATE. Which is incorrect.

Executing clean task on empty directory is the same as check that
directory is empty. Therefore, this up-to-date check can be removed.

^KT-62611 Verification Pending
2023-10-18 04:50:47 +00:00
Anton Lakotka 16c17d3c22 [Gradle] Check that commonized native distribution can be cleaned
^KT-62611 In-Progress
2023-10-18 04:50:47 +00:00
Anastasia.Nekrasova 9ad4cf4c55 [K2] Disappeared OPT_IN_USAGE_ERROR for a data class property during the destructuring declaration
^KT-62450
2023-10-17 21:27:13 +00:00
Dmitrii Gridin dfdd86da1f [FIR] do not capture class context during class annotations processing
^KT-62587
2023-10-17 20:32:11 +00:00
Dmitrii Gridin b03e3f0b0d [LL FIR] pass correct context during class annotation arguments mapping
The root cause of the problem is that we visit class annotations more
accurately than in the regular compiler transformer, so we have
a difference: the compiler assumes that annotation processing
of the class is called already inside this class, so it should enable
CLASS_HEADER_ANNOTATIONS mode to not capture extra context.
But we in LL FIR do this out of the class, so such context switching
is redundant and results in cutting out the outer class context

^KT-62587 Fixed
2023-10-17 20:32:11 +00:00
Dmitrii Gridin bbd09c6272 [LL FIR] add tests for nested class as annotation argument
^KT-62587
2023-10-17 20:32:11 +00:00
Dmitrii Gridin 5298d79dec [LL FIR] drop extra withContainingClass from annotation transformers
This call is redundant for annotation transformers because
they are override withRegularClass and add this call there,
so, as result, we have a class duplication in
containingClassDeclarations

^KT-62587
2023-10-17 20:32:11 +00:00
Dmitrii Gridin 21f81a8057 [LL FIR] fix lazy annotation arguments calculation for unresolved type references
Such references don't have explicit annotations yet (KT-62628), so we
should explicitly check type attributes

^KT-62625 Fixed
2023-10-17 20:32:11 +00:00
dependabot[bot] 50e75c6336 Bump @babel/traverse in /libraries/kotlin.test/js-ir/it
Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.22.5 to 7.23.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse)

---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-17 18:15:56 +00:00
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