Commit Graph

103909 Commits

Author SHA1 Message Date
Bogdan Mukvich 0aefd3b371 Add CODEOWNERS records for maven wrapper files 2023-08-23 09:07:28 +00:00
Pavel Kunyavskiy eefc51657a [K/N] Fix debug info for lambdas inside inline functions
^KT-57365
2023-08-23 08:18:56 +00:00
Pavel Kirpichenkov dc3641f79d Limit visibility of internal K/N decompiler classes
KTIJ-26526
2023-08-23 07:46:29 +00:00
Pavel Kirpichenkov af94b241ec Extract K/N decompiler related files into a separate module
KTIJ-26526
2023-08-23 07:46:29 +00:00
Pavel Kirpichenkov d7356afe1e Move K/N decompilers and stub builders to kotlin.git
KTIJ-26526
2023-08-23 07:46:29 +00:00
Aleksei.Glushko c5637ccc7e [K/N] Disable racy runtime test till better times
Merge-request: KT-MR-11788
Merged-by: Alexey Glushko <aleksei.glushko@jetbrains.com>
2023-08-22 21:04:26 +00:00
Dmitriy Novozhilov 10e45ee21a [FIR2IR] Disable lazy resolve checks at the very beginning of the FIR2IR 2023-08-22 18:36:21 +00:00
Dmitriy Novozhilov 250b94d5dd [FIR2IR] Create builtin IR class for @IntrinsicConstEvaluation manually if it is missing in stdlib
^KT-59151
2023-08-22 18:36:20 +00:00
Dmitriy Novozhilov 3f2e996803 [FIR2IR] Load builtin classes instead of creating them on the fly
This change uncovered KT-61282, which was hidden because of incorrect
  module fragments used as parent for builtin classes
2023-08-22 18:36:20 +00:00
Dmitriy Novozhilov f95ed2b588 [FIR2IR] Explicitly opt-in to IrSymbolInternals at call-sites
^KT-60924
2023-08-22 18:36:20 +00:00
Alexander Shabalin deb13257c2 [K/N] Make Any.equals simpler 2023-08-22 17:16:43 +00:00
Kirill Rakhman 27d25b90b1 [Tests] Fix test data 2023-08-22 16:06:24 +00:00
Mikhail Glukhikh 289dafa331 FIR2IR: don't apply SAM conversion for type parameter based types
#KT-58893 Fixed
#KT-58884 Fixed
2023-08-22 15:13:17 +00:00
Sebastian Sellmair a832510487 [Gradle] Use new Usage 'kotlin-commonized-cinterop' to differentiate cinterop commonizer configurations
^KT-61376 Verification Pending
2023-08-22 14:50:03 +00:00
Sebastian Sellmair fc2b700784 [Gradle] Implement KT61376CInteropCommonizerConfigurationsTest
to check Commonized CInterop configurations not are not
resolving variants from sqldelight, coroutines-extensions

KT-61376
2023-08-22 14:50:03 +00:00
Aleksei.Cherepanov feeddc4ea3 Extract interface from KotinFacetSettings 2023-08-22 14:02:33 +00:00
Ilya Gorbunov 5f5e76a09b kotlin-test-wasm: correct main source sets compilation, KT-61342
- Do not include test sources in main source sets
- Extract commonWasm source set that contains code shared between
wasm-js and wasm-wasi
2023-08-22 13:50:58 +00:00
Bogdan Mukvich 1458c81094 Add maven wrapper and mvn install gradle task 2023-08-22 13:45:45 +00:00
mvicsokolova 5f431e4e87 [K/N] Updated deprecations for native atomics
* Removed deprecated methods from the new atomics in kotlin.concurrent
* Changed deprecation level from WARNING to ERROR for the old atomics in kotlin.native.concurrent
* Removed FreezingIsDeprecated annotation from kotlin.concurrent.AtomicReference

See KT-58123

Merge-request: KT-MR-10650
Merged-by: Maria Sokolova <maria.sokolova@jetbrains.com>
2023-08-22 13:42:12 +00:00
Ilya Gorbunov ffbff15839 Add .idea/artifacts to .gitignore and delete already committed files from there, KTI-1337 2023-08-22 13:41:27 +00:00
mvicsokolova 76a1091820 [K/N]: Do not require JDK11 for :native:native.tests
This commit provides a small fix in the code of a native test runner so that JDK11 is not required and removes the JDK11 target for the atomicfu-compiler-plugin.

Fixes KT-61293

Merge-request: KT-MR-11757
Merged-by: Maria Sokolova <maria.sokolova@jetbrains.com>
2023-08-22 13:32:38 +00:00
Brian Norman 7db551c452 [FIR] Property accessors are not part of class initialization
When checking for class val property reassignment diagnostic, property
initializers should be treated as part of the class initialization.
However, property accessors should not. Previously, only the property
itself was checked for both of these situations and resulted in not
reporting diagnostic within property accessors.

#KT-59744 Fixed
2023-08-22 13:28:36 +00:00
Dmitrii Gridin e68cf38e99 [LL FIR] FirDeclarationForCompiledElementSearcher: avoid providers search for member declarations
This should improve performance and increase stability

^KT-61331
^KT-61014
2023-08-22 12:19:14 +00:00
Roman Efremov 1cf1a84594 [FE] Add TODO for safer check of memberExpectForActual writing
^KT-60668
^KT-60936
^KT-61361
2023-08-22 12:14:43 +00:00
Roman Efremov def4388c19 [FE, IR] Check annotations on expect and actual enum entries
^KT-60668
^KT-60936
2023-08-22 12:14:43 +00:00
Roman Efremov b57940a59b [FE1.0] Optimize search of expect class member in annotation checker
In the following scenario, when we search corresponding expect member
for actual `A.B`, we can skip checking compatibility of `B` scope.
```
class A {
  class B {
    fun foo() {}
  }
}
actual typealias AImpl = A
```

This is because:

1. Annotation checker runs no matter if found expect class is compatible
or not.
2. Class always has at most one corresponding `expect` class (unlike for
functions, which may have several overrides), so we are sure that we
found the right member.

^KT-60668
^KT-60936
2023-08-22 12:14:43 +00:00
Roman Efremov f1ea6545eb [IR] Fix incorrect position of reporting with fake overrides inside actual
^KT-60668
^KT-60936
2023-08-22 12:14:42 +00:00
Roman Efremov 58a30d524c [IR] Fix positioning of actual annotations diagnostic when reported on value
`parentsWithSelf` returns empty sequence if receiver is not a
`IrDeclarationParent`.

^KT-60668
^KT-60936
2023-08-22 12:14:42 +00:00
Roman Efremov ab1c0e3c48 [FE] Check annotations on actual class members including fake overrides
^KT-60668
^KT-60936
2023-08-22 12:14:42 +00:00
Roman Efremov d614f06259 [FE 1.0] Refactor: extract logic of matching actual against potential expects
Will be needed in subsequent commits for the annotation checker.
`findExpectForActual` is not suitable for the checker because
`findExpectForActual` searches expect class with same `ClassId` for
actual class containing current member (see method
`findClassifiersFromModule`), which is:
1. Unnecessary, since we already have expect class in annotation checker
2. Incorrect when class actualized via typealias and `ClassId` is
   different.

So, it is needed to extract logic of searching potential expects
for actual member and already known expect class.

^KT-60668
^KT-60936
2023-08-22 12:14:42 +00:00
Roman Efremov 8aa3ccd342 [FIR] Store matched actual class members inside FIR attribute
Currently, there is only attribute `ExpectForActualAttributeKey`
where mapping is stored only for source declarations with `actual`
modifier. But we need mapping of all class members, including classes
which were actualized via `actual typealias` or fake override members.
This data will be needed for the annotation checker in subsequent
commits.

^KT-60668
^KT-60936
2023-08-22 12:14:42 +00:00
Roman Efremov 2f00ed3ed7 [FE] Refactor: reorganize methods in AbstractExpectActualAnnotationMatchChecker
Separate callable and class checks to prepare for checking
class scopes. Extract common checks to separate methods.

Also, it is found that in IR checker annotations on type parameters also checked,
because they stored in `matchedExpectToActual`. But it is expected that
only classes and callables are checked. This started to fail because of
added input parameter type checks inside `areAnnotationsCompatible`.
That's why `expectSymbol is IrTypeParameterSymbol` early-return is added.

^KT-60668
^KT-60936
2023-08-22 12:14:42 +00:00
Mikhail Glukhikh 8cbefcc26f K2: add test to ensure #KT-55981 Obsolete 2023-08-22 11:40:26 +00:00
Mikhail Glukhikh 27afee8683 K2: generate bounds for inner-class based raw types properly
#KT-58579 Fixed
2023-08-22 11:40:26 +00:00
Mikhail Glukhikh 4e2067a163 K2: reproduce KT-58579 2023-08-22 11:40:25 +00:00
Mikhail Glukhikh 2ff075c961 FIR2IR: use ELVIS origin only on wrapping blocks #KT-60250 Fixed 2023-08-22 11:20:19 +00:00
Mikhail Glukhikh b06188180e FIR2IR: don't generate 'none' type arguments for Java field references
#KT-60254 Fixed
2023-08-22 11:20:19 +00:00
Mikhail Glukhikh 9846ec23df Raw FIR: generate 'return setValue' instead of just 'setValue'
#KT-61045 Fixed
2023-08-22 11:20:19 +00:00
Mikhail Glukhikh 7d5e2f85cc FIR2IR: don't generate unnecessary 'return throw'
#KT-60245 Fixed
2023-08-22 11:20:19 +00:00
Vladimir Sukharev 90904e4f8a [Tests] Add missing diagnostics handler to irText tests
Merge-request: KT-MR-11721
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-08-22 10:44:41 +00:00
Nikita Bobko ccfbb5f77a [FE] Don't issue a deprecation warning for open val deferred init when the property is unconditionally effectively final
^KT-61228 Fixed
Review: https://jetbrains.team/p/kt/reviews/11694/timeline
2023-08-22 10:15:22 +00:00
Nikolay Lunyak c33f1cda69 [FIR] Report MISSING_CONSTRUCTOR_KEYWORD
^KT-59407 Fixed
2023-08-22 09:13:16 +00:00
Nikolay Lunyak f238ffa4bf [FIR] Make FirErrorConstructor a FirDiagnosticHolder 2023-08-22 09:13:16 +00:00
Roman Efremov 673b4b4d52 [FE] Add OptIn annotation to whitelist of annotation checker
It's valid to have `@OptIn` only on `expect` declaration.

^KT-61373
2023-08-22 09:02:20 +00:00
Pavel Kunyavskiy 8bcd1f4efa [FIR/Native] Move fir-related code from backend.native module to new one
^KT-61249
2023-08-22 08:56:16 +00:00
Alexander Udalov fdab636a1b Tests: add missing language version in a Java modules test
The main function in this test class to compile a bunch of sources is
`module`, which was changed to test different language versions in
4e706ba93e. But this test uses `compileLibrary` directly, so we need to
pass LV manually.

 #KT-60797
2023-08-22 08:34:18 +00:00
Dmitrii Krasnov ade88e2b0f Fixed konan.data.dir with caches
Removed TODOs after updating to kotlin bootstrap version with konan.data.dir gradle property changes

Fixed warning of incorrect passing -Xkonan-data-dir arg in konanc from KGP and fixed setting konan-data-dir in SetupConfiguration#setupCommonOptionsForCaches

#KT-60660 Fixed

Merge-request: KT-MR-11299
Merged-by: Dmitrii Krasnov <Dmitrii.Krasnov@jetbrains.com>
2023-08-22 07:56:26 +00:00
Yahor Berdnikau e8905ea849 [Gradle] Fix loosing compiler plugin options with the same plugin ID
The most common use case is to add one CompilerPluginOptions to another
while both may have options with the same plugin ID.

^KT-54160 Fixed
2023-08-22 07:53:18 +00:00
Nikolay Krasko df55283148 Revert "[Build] Fix usage of --scan parameter with test retry"
It looks like tests retry doesn't work sometimes.

This reverts commit ecd06ac47b.

KTI-1346 KTI-1339
2023-08-21 21:01:18 +00:00
Dmitrii Gridin 695f6f0062 [SLC] fix annotation retention mapping
^KT-61377 Fixed
2023-08-21 20:46:25 +00:00