Commit Graph

104076 Commits

Author SHA1 Message Date
Mikhail Glukhikh 5ee50f50b5 K2/LC: set hasBackingField to false for expect properties
#KT-61173 Fixed
2023-08-23 13:48:48 +00:00
Roman Efremov 6b217369a8 [FE1.0] Fix false reporting of non-matching annotations in IDE...
...when typealiased expect class used in class literal.

^KTIJ-26700 Fixed
2023-08-23 13:15:20 +00:00
Roman Efremov 3124cbcbad [FE, IR] Refactor: rename areAnnotationArgumentsEqual parameters
Rename to "expect" and "actual" annotation.
This will be needed in next commit to make it clear that
only expect annotation value needs special handling.

^KTIJ-26700
2023-08-23 13:15:20 +00:00
Roman Efremov 77ab13400e [FE1.0] Fix false reporting of non-matching actual annotations in IDE
It was reported because in composite module analysis we have both expect
and actual annotation descriptors, which may differ.
This may lead to bugs in the checker of ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT
diagnostic.

`fqName` comparison can be safely removed, because we already check
types in `areCompatibleExpectActualTypes`.

Tests:
- typealiasedAnnotation.kt - for annotation use (so it has different
ClassId)
- typealiasedAnnotationAsArgument.kt - when typealiased annotation
used in another annotation as argument
- sourceRetentionAnnotationsWhenTypealias.kt - tests same as
compiler/testData/diagnostics/tests/multiplatform/annotationMatching/sourceRetentionAnnotationsWhenTypealias.kt

No special test added for opt-in, because it's prohibited to have
expect/actual opt-ins by EXPECT_ACTUAL_OPT_IN_ANNOTATION checker.

^KTIJ-26700
2023-08-23 13:15:20 +00:00
Nataliya.Valtman dce1c1c70a Fix flaky tests with ConcurrentModificationException 2023-08-23 13:01:47 +00:00
Nikolay Lunyak 6e732f2f4d [FIR] Report NON_SOURCE_ANNOTATION_ON_INLINED_LAMBDA_EXPRESSION
^KT-59422 Fixed
2023-08-23 12:39:23 +00:00
Nikolay Lunyak ed6a0af0a6 [FIR] Report DUPLICATE_PARAMETER_NAME_IN_FUNCTION_TYPE
^KT-59418 Fixed
2023-08-23 12:38:38 +00:00
Yahor Berdnikau 7d48a7934f [Gradle] Fix tryK2 was not applied to Kotlin/JS gradle plugin
^KT-61193 Fixed
2023-08-23 12:36:46 +00:00
Nikita Bobko c42d19f0e5 Cover KT-60646 with regression tests
This behavior wasn't intended during KT-15470 coding. I only intended to
prohibit `@get:` target on things different from properties. But I
accidentally prohibited `@property` on things different from properties
too

But it's a bug fix anyway, so let's keep it.

I also re-checked the implementation of KT-15470, I don't see any other
unintentional prohibitions
2023-08-23 12:35:51 +00:00
Nikita Bobko 7e4f9def83 Fix that INAPPLICABLE_TARGET_ON_PROPERTY_WARNING diagnostic is considered as an error
It was a stupid copy-paste typo. Please notice that this bug is only
presented in K2. In K1, INAPPLICABLE_TARGET_ON_PROPERTY_WARNING is a
warning.

But in K2, INAPPLICABLE_TARGET_ON_PROPERTY_WARNING doesn't matter as
much because it's only possible when LV <= 1.9. But K2 frontend doesn't
guarantee support of language flags that are < 2.0, anyway.

There are no tests because the test would be too trivial.
2023-08-23 12:35:50 +00:00
vmishenev 5c0c8ed2d5 Update Dokka to 1.9.10-dev
- Use analysis plugin configuration instead of `StdLibAnalysisConfigurationPlugin`
- Change SamplesTransformer plugin after Dokka refactoring
2023-08-23 12:33:40 +00:00
Alexander Shabalin 18fb2ec476 [K/N] Don't build distribution for deprecated targets ^KT-59008 2023-08-23 11:46:59 +00:00
Kirill Rakhman e96dcef571 [FIR2IR] Convert annotations on local delegated properties
#KT-60292 Fixed
2023-08-23 11:09:35 +00:00
Ilya Chernikov 85ca5294ef K2: add test for already fixed missing diagnostic issue
#KT-55956
2023-08-23 09:40:45 +00:00
Ilya Chernikov 4b7234d27e K2: add test for already fixed qualifier resolve issue
#KT-57845
2023-08-23 09:40:44 +00:00
Dmitrii Gridin 3debf36d60 [FIR] DFA: add missing unwrap for FirDesugaredAssignmentValueReferenceExpression
^KT-60319 Fixed
^KT-61407 Fixed
2023-08-23 09:15:25 +00:00
Dmitrii Gridin c01d27a61e [FIR] VariableStorageImpl: add debug info
^KT-60319
^KT-61407
2023-08-23 09:15:25 +00:00
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