Commit Graph

103256 Commits

Author SHA1 Message Date
Marco Pennekamp bf5f41a0ad [AA] Fix link to LLFirResolveSessionService in KDoc 2023-07-31 15:58:00 +00:00
Ilya Kirillov 5ac0d2e603 [Analysis API] remove analyzeInModalWindow to the intellij repository
As it's IDE-specific functionality
2023-07-31 15:40:57 +00:00
Ilya Kirillov 32456a1611 [kotlin] remove analyzeWithReadAction
It's the responsibility of the caller to decide if read action is needed
2023-07-31 15:40:57 +00:00
Ilya Kirillov 62e856956c [stub builder] generate K2 test output for the testsuite where classfiles are generated by the K2 compiler
The result of k1/k2 should be similar here, the differences should be fixed by KT-60764
2023-07-31 15:38:07 +00:00
Ilya Kirillov ce990853da [stub builder] generate tests for the testsuite where the classfiles generated by the K2 compiler
The result of k1/k2 should be similar here, the differences should be fixed by KT-60764
2023-07-31 15:38:07 +00:00
Ilya Kirillov 419c0c83e3 [stub builder] introduce a separate testsuite where classfiles generated by the K2 compiler
The result of k1/k2 should be similar here, the differences should be fixed by KT-60764
2023-07-31 15:38:07 +00:00
Dmitry Savvinov 2ab73f286a [mpp] Add test: pre-hmpp dependencies not reported in test source sets
Test source sets do not participate in the metadata compilations by
default, so the check misses them. This commit just encodes this
behavior into tests, without actually addressing it

KT-60724
2023-07-31 15:36:21 +00:00
Dmitry Savvinov 38cd8ee7e7 [mpp] Don't report kotlin-test as pre-HMPP dependency
- Exclude kotlin-stdlib and kotlin-test from reporting

- kotlin-stdlib wasn't reported, because it doesn't even have Gradle
modular metadata (so no o.j.k.platform.type attribute, and check doesn't
work). This commit explicitly excludes kotlin-stdlib, so that when it
starts publishing Gradle Modular Metadata, nothing would break

- kotlin-test was reported only when it is declared in commonMain,
because we're checking only metadata compilations, and commonTest
isn't compiled to metadata

- Depending on kotlin-test is an odd configuration, but it arises
sometimes (e.g. when people extract some test utilities in a separate
Gradle project)

^KT-58872
2023-07-31 15:36:21 +00:00
Dmitry Savvinov 14b340c61e [mpp, tests] Assert that all dependencies are resolved, fix misconfigurations
- Assert that all dependencies are resolved. Gradle won't fail the build
by default, which might lead to test running in a weird misconfigured
state and producing unreliable results (can be green even though there
are bugs)

- Fix several typos and misconfigurations that were revealed after
adding assertion described above
2023-07-31 15:36:21 +00:00
Timofey Solonin 1832a6d936 [KT-58234][MPP] Demote KotlinCompilation.source deprecation to a warning
^KT-58234
2023-07-31 15:34:29 +00:00
Timofey Solonin 181d6b64a2 [MPP] Add ExperimentalForeignApi to CocoaPods tests
^KT-58362
2023-07-31 15:33:34 +00:00
Yahor Berdnikau 8df905a326 [Gradle] LanguageSettings now is wrapper for related compiler options
'KotlinSourceSet.LanguageSettings' is now acts as a wrapper for the
related Kotlin compilation task 'compilerOptions' object, similar to how
'kotlinOptions' is working now.

Source sets consistency check now will ignore shared source sets with no
linked compilation to avoid users need to configure them as well.

^KT-57292 In Progress
2023-07-31 15:31:56 +00:00
mvicsokolova bed16f92b1 [atomicfu-K/N]: Support Native backend in atomicfu compiler plugin
Atomicfu compiler plugin supported transformations for K/N:
* atomic properties are replaced with volatile properties and all the operations are delegated to native atomic intrinsics
* atomic arrays are replaced with kotlin.concurrent.Atomic*Arrays
* all other features available on JVM are covered as well (custom atomic extensions, delegated properties, debug tracing)

See (KT-58358, https://github.com/Kotlin/kotlinx-atomicfu/issues/261)

Merge-request: KT-MR-11253
Merged-by: Maria Sokolova <maria.sokolova@jetbrains.com>
2023-07-31 14:48:28 +00:00
Vladimir Sukharev 15b2ad4943 [WASM] Disable test that failed/passed on different platforms
^KT-60700


Merge-request: KT-MR-11339
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-07-31 14:30:58 +00:00
Stanislav Erokhin 5f07db3c22 Annotate transitiveExport with @ExperimentalKotlinGradlePluginApi
#KT-59196 Verification Pending
2023-07-31 13:54:17 +00:00
Alexander Udalov 9c03dcd230 Do not write version requirements for suspend functions
Previous attempt was at 6807ed6642, but it was reverted in 7771e5914d
(see that commit for the explanation). Now it should be fine to remove
these version requirements.

No issue reported because it's mostly not a user-visible change. The
main effect is that it reduces differences in metadata between K1 and
K2, namely it fixes the ValueClass.kt kotlinp test.
2023-07-31 13:05:29 +00:00
Alexander Udalov 06e370b012 K2: use Any? as last argument when serializing suspend types
K1 uses `Any?` in `transformSuspendFunctionToRuntimeFunctionType`, so
use `Any?` in K2 too.

This type is not used for anything, it's just an artifact of how suspend
types are represented in metadata. It's removed during deserialization
(see `TypeDeserializer.createSuspendFunctionType` or
`FirTypeDeserializer.createSuspendFunctionType`). So it's not a
user-visible change. The only effect is that it reduces differences in
metadata between K1 and K2, namely in the test
`libraries/tools/kotlinp/testData/ValueClass.kt`.
2023-07-31 13:05:29 +00:00
Alexander Udalov afd35accd8 Do not write version requirements for InlineClasses
Language feature InlineClasses is enabled since 1.3. The current lowest
supported language version is 1.4, so any compiler that can read
binaries produced by the current compiler also supports inline classes,
which means that the version requirement is not needed anymore.

No issue reported because it's mostly not a user-visible change. The
main effect is that it reduces differences in metadata between K1 and
K2, because K2 never supported writing this version requirement properly
due to the TODO in `hasInlineClassTypesInSignature`.
2023-07-31 13:05:29 +00:00
aleksandrina-streltsova 9e50a3b71d [FIR] create snapshot of collected tower data context for declaration
KTIJ-26113
2023-07-31 10:50:12 +00:00
aleksandrina-streltsova af6672c87d [FIR] store tower data context for operand in and/or binary expression
KTIJ-26113
2023-07-31 10:50:12 +00:00
aleksandrina-streltsova 2f2eb86195 [FIR] save tower data context for expression in when entry
^KTIJ-26113 Fixed
2023-07-31 10:50:11 +00:00
Alexander.Likhachev 18aa7f4d4b [BT] Implement non-incremental compilation within the daemon
#KT-57398 In Progress
2023-07-31 10:38:35 +00:00
Johan Bay fafea27283 [klib tool] Add option to print ir
Dumping the IR from a klib is useful for debugging klib compilations.

^KT-58877
2023-07-31 09:45:19 +00:00
Kirill Rakhman b0f1746012 [FIR] Set actual modifier on implicitly actual primary constructors
... of annotations and inline classes.

#KT-60139 Fixed
2023-07-31 09:35:51 +00:00
Nataliya.Valtman fb04356829 Add JPS iteration metric
#KT-58026 In progress


Co-authored-by: Nataliya Valtman <Nataliya.Valtman@jetbrains.com>


Merge-request: KT-MR-11365
Merged-by: Aleksei Cherepanov <aleksei.cherepanov@jetbrains.com>
2023-07-31 09:15:28 +00:00
Ivan Kylchik ecdb08952b [IR] Restore compatibility with IDEA after moving toIrConst function
#KT-60744 Fixed
2023-07-31 09:01:19 +00:00
Ilya Kirillov de4224296d [Analysis API FIR] fix reference resolve to reified type parameter 2023-07-31 08:43:59 +00:00
Stanislav Erokhin b3236c5824 [mpp] Set the minimum supported gradle to 6.8.3 (same as in KGP)
KGP supports only Gradle since 6.8.3, and we run tests on
buildserver only since this version, so we shouldn't try to work if
gradle < 6.8.3.
And in general in MPP plugin we shouldn't support version that is not
supported in KGP

#KT-59278
2023-07-31 08:25:37 +00:00
Kirill Rakhman 0a469ff3b9 [FIR] Use class scope to get constructors for redeclaration check
#KT-60793 Fixed
2023-07-31 08:13:49 +00:00
Dmitrii Krasnov e7c589a573 Added FUS statistics for applied plugins: kotlin-js, cocoapod plugin
#KT-59324 In Progress


Merge-request: KT-MR-11360
Merged-by: Dmitrii Krasnov <Dmitrii.Krasnov@jetbrains.com>
2023-07-31 07:33:17 +00:00
Alexander Udalov 3ff21db77f Tests: remove unused .diag.txt file 2023-07-29 23:06:23 +00:00
Alexander Udalov 0a748f8ea0 Tests: remove .txt dumps from diagnostic tests with JVM backend
They are mostly useless now.
2023-07-29 23:06:23 +00:00
Alexander Udalov 965946d3ef K2: report JVM backend errors in the same way in PSI as LT
Do not try to find PSI element, but always use the IR element offsets
instead. This greatly simplifies test data because we don't need to have
custom PSI- and LT- based diagnostic ranges in every test, and K1/K2
behavior also is mostly the same.

The exact offset ranges are not as important for backend diagnostics, so
it's better to have K2+PSI and K2+LT behaving the same.
2023-07-29 23:06:23 +00:00
Alexander Udalov 6069aaee9c K2: report JvmMultifileClass+JvmSynthetic error in JVM backend
Specifically, the case when not all parts of a multifile class are
annotated with `@JvmSynthetic`. Report the error on the
`@JvmMultifileClass` annotation instead of the package directive,
because the latter is difficult to find via IR. This fixes the test
FirLightTreeDiagnosticsTestWithJvmIrBackendGenerated.MultifileClasses.testJvmSynthetic.

 #KT-59586
2023-07-29 01:14:29 +02:00
Alexander Udalov 96ddd9bbf3 K2: report INLINE_CALL_CYCLE error in JVM backend
This fixes the following
FirLightTreeDiagnosticsTestWithJvmIrBackendGenerated tests:

  testPropertyInlineCycle
  testInlineCycle
  testSuspendInlineCycle
  testIndirectInlineCycle

 #KT-59586
2023-07-29 01:14:29 +02:00
Alexander Udalov 5f2ff06296 Add tests for JVM backend diagnostics with K2 light tree
In the vast majority of tests, diagnostics are reported at a slightly
different location in LT vs PSI. This is because in the light tree mode,
backend errors are reported basically on the start of the IR element,
which is for example the keyword "class" for a class and not its name as
in K1 or in K2+PSI. Similarly, the end of the diagnostic is at the
ending offset of the IR element.

Normally it would be a bit user-unfriendly to highlight the whole class
as red, starting from the keyword "class" and ending with the closing
brace "}". But remember that these are backend diagnostics in the K2+LT
mode, which is only possible in the compiler scenario, not in the IDE.
And in this case, the ending offset doesn't matter at all because it's
not presented to the user, and minor change in the starting offset is
not a problem as well.

There are some tests which legitimately fail in the LT mode because the
corresponding diagnostics haven't been supported. They will be dealt
with in subsequent commits:

  testPropertyInlineCycle
  testInlineCycle
  MultifileClasses.testJvmSynthetic
  testSuspendInlineCycle
  testIndirectInlineCycle

 #KT-59586
2023-07-29 01:14:29 +02:00
Alexander Udalov 69c698134b Tests: do not depend on PSI in JvmBackendDiagnosticsHandler
#KT-59586
2023-07-29 01:14:29 +02:00
Alexander Udalov b81c637fed Minor, simplify FirDiagnosticsCompilerResultsReporter.reportByFile 2023-07-29 01:14:29 +02:00
Igor Yakovlev f2ea2021d7 [Wasm] Add wasi target attribute 2023-07-28 20:19:55 +02:00
Sebastian Sellmair db5655d6ce [Gradle] Implement InternalKotlinTargetPreset
^KT-59321 In Progress
2023-07-28 17:53:45 +00:00
Timofey Solonin 969deb639c [MPP] Deprecate preset APIs
^KT-59321
2023-07-28 17:53:45 +00:00
Timofey Solonin a580d4e5aa [MPP] Validate fromPreset API changes 2023-07-28 17:53:45 +00:00
Timofey Solonin 0ad8407b57 [MPP] Add TargetPreset APIs deprecation tests
^KT-59321
2023-07-28 17:53:45 +00:00
Dmitrii Gridin da71a152cd [FIR] update FirRenderer for scripts
^KT-60728
2023-07-28 17:49:14 +00:00
Dmitrii Gridin 2bacba5a9a [LL FIR] add one more complex test case for scripts
^KT-60728
2023-07-28 17:49:14 +00:00
Zalim Bashorov 0bdee00ca2 [Wasm] Use Node.js with "canary" v8 (11.7.310.0) in tests
There are no other non-canary Node.js versions using fresh enough v8.
2023-07-28 16:16:34 +00:00
Zalim Bashorov cead5c8aae [Wasm] Update Binaryen to 114
This version supports new br_on_cast* instructions.

Also, stop passing to binaryen no longer supported option.
2023-07-28 16:16:34 +00:00
Zalim Bashorov a1115236f9 [Wasm] Disable deprecated instructions while running tests in V8
To make sure that our implementation is up-to-date with the spec.
2023-07-28 16:16:34 +00:00
Zalim Bashorov 4572680877 [Wasm] Migrate to the latest br_on_cast* instructions
#KT-59722 Fixed
2023-07-28 16:16:33 +00:00
Zalim Bashorov 9254f70c2a [Wasm] Update SpiderMonkey to 2023-07-24-09-16-21 2023-07-28 16:16:33 +00:00