Commit Graph

102646 Commits

Author SHA1 Message Date
Stanislav Ruban 4f92008f01 [test docs] Actualize the README.md for diagnostic tests somewhat 2023-07-13 13:41:36 +00:00
Stanislav Ruban 5c644bcac8 [test infra] Add a directive for type checking utils that use @Exact 2023-07-13 13:41:36 +00:00
Andrei Klunnyi 0323b0fb19 KT-59801 [FIR] scripting: tests for reference shortening 2023-07-13 15:21:39 +02:00
Dmitrii Gridin 3d40eba379 [LL FIR] LLFirContractsLazyResolver: add isResolved check
Currently, FirLegacyRawContractDescription is a valid class for
resolved contract in case of error description.
This condition should be dropped after KT-60310

^KT-60310
2023-07-13 12:27:02 +00:00
Dmitrii Gridin 4b330e88be [LL FIR] LLFirLazyResolver: implement checkIsResolved
To simplify logic and avoid boilerplate
2023-07-13 12:27:02 +00:00
Dmitrii Gridin 5b6e6b7a4e [LL FIR] LLFirLazyResolver: implement updatePhaseForDeclarationInternals
To avoid code duplication in each implementation
2023-07-13 12:27:02 +00:00
Dmitrii Gridin 660385b67d [LL FIR] move annotation type checks to TYPES phase resolver
LLFirTypeTargetResolver in general is responsible for annotation
type resolution, so such checks should be done on its phase.

Also, there is no sense to trying to check a type of annotation mapping
values because they will be initialized only during
LLFirAnnotationArgumentsMappingTargetResolver so, in most cases,
current check during LLFirAnnotationArgumentsLazyResolver is useless

^KT-60295 Fixed
2023-07-13 12:27:02 +00:00
Abduqodiri Qurbonzoda fed453fdea Provide Common StringBuilder.append/insert with primitive type arguments #KT-57359
Merge-request: KT-MR-10892
Merged-by: Abduqodiri Qurbonzoda <abduqodiri.qurbonzoda@jetbrains.com>
2023-07-13 11:52:14 +00:00
Andrei Klunnyi 2d50bd6857 KT-60193 scripts: configuration discovery might fail silently (2)
This commit covers one more case similar to what is described
in the previous commit of the series (c9eebffb).
2023-07-13 13:31:52 +02:00
Jinseong Jeon 5596c3ae80 AA: better error message for file w/o containing module
...instead of throwing NoSuchElementException
2023-07-13 11:51:23 +02:00
Dmitrii Gridin b67b37cdb3 [FIR] FirJavaFacade: do not duplicate record constructor
The fresh version of intellij has all record-related declarations,
so an additional fake constructor leads to errors like
KTIJ-25364 (OVERLOAD_RESOLUTION_AMBIGUITY)

^KTIJ-25366 Fixed
^KTIJ-25364 Fixed
^KTIJ-25368 Fixed
^KTIJ-25370 Fixed
2023-07-13 09:21:38 +00:00
Dmitrii Gridin 97a12af03e [FIR] fix publication race in fakeOverrideSubstitution
Problem: fakeOverrideSubstitution was set to null before the return
type was published, so another thread can see a state where
fakeOverrideSubstitution is null and a return type is implicit
simultaneously

^KT-60385
^KT-59758 Fixed
2023-07-13 09:17:08 +00:00
Mikhail Glukhikh 17da09bf17 K2: add ConeKotlinType argument for NULL_FOR_NONNULL_TYPE 2023-07-13 09:07:39 +00:00
Mikhail Glukhikh 9d9d7880af K2: render types in quotes in diagnostic messages 2023-07-13 09:07:39 +00:00
Mikhail Glukhikh c839cd3c11 K2: don't use debugging type renderer in error messages 2023-07-13 09:07:39 +00:00
Yahor Berdnikau bd000e61f6 [repo] Migrate resolveDependencies.gradle.kts into convention plugin
Otherwise, it could not find methods from buildsrc-compat.
2023-07-13 08:24:50 +00:00
Yahor Berdnikau 3209dbbf10 [repo] Migrate ideaRtHack.gradle.kts into convention plugin
Otherwise, it could not find methods from buildsrc-compat.
2023-07-13 08:24:50 +00:00
Yahor Berdnikau 9cc28406a6 [repo] Migrate modularizedTestConfigurations.gradle.kts into convention plugin
Otherwise, it could not find methods from buildsrc-compat.
2023-07-13 08:24:50 +00:00
Yahor Berdnikau e1ffe34088 [repo] Migrate jps.gradle.kts into convention plugin
Otherwise, it could not find methods from buildsrc-compat.
2023-07-13 08:24:50 +00:00
Yahor Berdnikau 8018b5f63b [repo] Migrate javaInstrumentation.gradle.kts into convention plugin
Otherwise, it could not find methods from buildsrc-compat.
2023-07-13 08:24:50 +00:00
Yahor Berdnikau d686cb1365 [repo] Migrate report.gradle.kts into convention plugin
Otherwise, it could not find methods from buildsrc-compat.
2023-07-13 08:24:50 +00:00
Yahor Berdnikau 5b5dae9249 [repo] Move buildSrc into repo/gradle-build-conventions/buildsrc-compat project
Include new project as build logic included build. Such change will
allow us to start migration into build convention plugins by splitting
buildSrc logic into subprojects.
2023-07-13 08:24:49 +00:00
Roman Efremov 4a598afc36 [FE] Prohibit expect or actual opt-in annotations
^KT-58554
2023-07-13 08:15:42 +00:00
Sebastian Sellmair 600bb3dbc7 Bump Kotlin/Native version in KGP to 1.9.20-dev-6271
KT-59859
2023-07-12 20:17:03 +00:00
Sebastian Sellmair 3f0130ecf1 [Gradle] Change 'UnsafeNumber' RequiresOptIn.level to 'ERROR'
^KT-59859 Verification Pending
^KT-55757 Verification Pending
2023-07-12 20:17:03 +00:00
Denis.Zharkov 54962d5ec3 K2: Simplify FirDeclarationsResolveTransformer.transformAccessor
WithExpectedType mode was only needed to replace return type for the
getter, so I made it explicit there

After that, `resolutionMode` in `transformFunctionWithGivenSignature`
became effectively constant
2023-07-12 17:28:44 +00:00
Denis.Zharkov 8cee2c36d3 K2: Get rid of enhancedTypeRef concept in property accessors
As it's always equal to the latest value at `property.returnTypeRef`
2023-07-12 17:28:43 +00:00
Anna Kozlova a2cefbc6be [LL] retrieve module by original file
originalDeclaration is set for non-local declarations only,
thus requesting symbols for local declarations still goes
with non-physical elements
This lead to ModuleKind.BINARY_MODULE
for `NotUnderContentRootModule`s, because the declaring file is different

KT-60377
2023-07-12 15:37:53 +00:00
Pavel Punegov 61ba29a775 [K/N][test] Excluded filecheck_signext_zeroext_objc_export
With enabled two-stage compilation test fails to match bridges
which generation depends on order
See ^KT-58863
2023-07-12 14:46:27 +00:00
mvicsokolova d9fa9c1b3b [K/N] Introduce intrinsics that atomically update array elements
Supported atomic update of elements for IntArray, LongArray and Array<T>
See KT-58360

Merge-request: KT-MR-11020
Merged-by: Maria Sokolova <maria.sokolova@jetbrains.com>
2023-07-12 14:32:36 +00:00
Ivan Kochurkin 20c53fc15d Unify JvmSignatureSerializer 2023-07-12 13:11:25 +00:00
Ivan Kochurkin 4d24a8b40c [FIR] Remove duplicated code discovered by running inspection 2023-07-12 13:11:25 +00:00
Ivan Kochurkin 1a28067b76 [FIR] Merge FirBasedKotlinMangler into FirMangler
FirMangler has only one implementation and it's FirBasedKotlinMangler

It looks excessive
2023-07-12 13:11:24 +00:00
Ivan Kochurkin ca93165044 [FIR] Remove useless code discovered by code coverage 2023-07-12 13:11:24 +00:00
Pavel Mikhailovskii 9486d966dc [FIR] Keep slashes in FirJvmTypeMapper.Context.getClassInternalName 2023-07-12 13:06:00 +00:00
Artem Daugel-Dauge e093852ebb [Gradle] Fix test data after KT-58316 2023-07-12 13:04:39 +00:00
Yahor Berdnikau 73f6316f27 [repo] Enable warnings as errors for Gradle Kotlin scripts 2023-07-12 12:49:32 +00:00
Yahor Berdnikau ed8fc64257 [repo] Update to Gradle 8.2.1 version
This Gradle release also fixes 2 security vulnerabilities:
https://docs.gradle.org/8.2.1/release-notes.html
2023-07-12 12:49:32 +00:00
Dmitrii Krasnov f2816a5531 Added property for overriding konan distribution location
#KT-50463 Fixed

Merge-request: KT-MR-10310
Merged-by: Dmitrii Krasnov <Dmitrii.Krasnov@jetbrains.com>
2023-07-12 12:36:51 +00:00
Anton Lakotka 2f7f69ed4f [Gradle] Remove requiresVisibilityOf API and related checks
^KT-58228 Verification Pending
2023-07-12 11:59:27 +00:00
Brian Norman 10ed26991d [FIR] Extract LHS receiver of assignment operator statements
#KT-53490 Fixed
2023-07-12 11:41:33 +00:00
Sebastian Sellmair 14276642d4 [Gradle] Deprecate ios target shortcut
Which was forgotten in 0b57dac738

^KT-58676 Verification Pending
2023-07-12 10:51:01 +00:00
Timofey Solonin c245fa45e3 Split K2 and K1 test data for multiplatform feature diagnostic
and add an explicit expect to the test data

^KT-31281
2023-07-12 10:50:33 +00:00
Sebastian Sellmair 0880b4cb34 [Gradle] KotlinTargetsDsl: Remove undesirable AnnotationRetention.SOURCE
KTIJ-26247
2023-07-12 10:50:11 +00:00
Alexander.Likhachev 009cda5062 [Gradle] Adjust the MPP test project for KT-34901
Following the resolution of KT-59595, the java plugin is no longer applied in MPP projects. However, the `java-test-fixtures` plugin is currently non-functional due to its reliance on the `java` plugin (https://github.com/gradle/gradle/blob/e95eafb8c43c5cd404bd235fa0a69c58cab6f5d6/subprojects/plugins/src/main/java/org/gradle/api/plugins/JavaTestFixturesPlugin.java#L60).
2023-07-12 10:20:15 +00:00
Anton Lakotka a55b74d4e0 [Gradle] Elevate DeprecatedJvmWithJavaPresetDiagnostic to error
^KT-59320 Verification Pending
2023-07-12 10:19:39 +00:00
Anton Lakotka cd5e4611eb [Gradle] Elevate CommonMainWithDependsOnDiagnostic to error
^KT-59311 Verification Pending
2023-07-12 10:19:38 +00:00
Anastasia.Nekrasova fcba0ad75e [Test] Add a test covering for resolution to subsumed members for raw types
^KT-57620
2023-07-12 09:11:01 +00:00
Timofey Solonin e12e78d96b Add an explicit diagnostic for when expect/actual modifiers are used in
an unsupported compilation

^KT-31281
2023-07-12 08:29:28 +00:00
Nikolay Krasko cab0487f98 Fix implicit dependency validation for zipCompilerSign
Checksum tasks uses the directory output, but the directory is not
empty, compiler.zip is among files in target directory. And this is
probably the reason why gradle now claims zipCompilerChecksum should be
added as direct dependency (see the error message below).

Workaround: generate checksum in separate directory and copy the
resulting file to directory with the compiler.zip. Note that `Copy` task
can't be used because it also declares target directory as an output.

Reproduce:

```
gradle zipCompilerWithSignature -Psigning.gnupg.keyName=???????? -Psigning.gnupg.passphrase=test -PsigningRequired=true -Pteamcity=true
```

Error:

```
org.gradle.internal.execution.WorkValidationException: A problem was found with the configuration of task ':zipCompilerSign' (type 'Sign').
    - Gradle detected a problem with the following location: '/mnt/agent/work/***/kotlin_CompilerArtifacts/dist/kotlin-compiler-1.9.20-dev-6119.zip'.

      Reason: Task ':zipCompilerSign' uses this output of task ':zipCompilerChecksum' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.

      Possible solutions:
        1. Declare task ':zipCompilerChecksum' as an input of ':zipCompilerSign'.
        2. Declare an explicit dependency on ':zipCompilerChecksum' from ':zipCompilerSign' using Task#dependsOn.
        3. Declare an explicit dependency on ':zipCompilerChecksum' from ':zipCompilerSign' using Task#mustRunAfter.

      Please refer to https://docs.gradle.org/8.1.1/userguide/validation_problems.html#implicit_dependency for more details about this problem.
```

KTI-1285
2023-07-12 07:37:28 +00:00