Commit Graph

100584 Commits

Author SHA1 Message Date
Anna Kozlova 4fe239375f [cls] write contracts information to cls stubs
^ KTIJ-24665
this information would be used to create resolved FirElements from stubs,
so no ProtoBuf would be kept in memory
2023-04-25 08:34:18 +00:00
Dmitriy Dolovov 9d4db72d72 [PL] Fix: Don't raise an error when external interface inherits from external class
^KT-57378
2023-04-25 08:00:14 +00:00
Dmitriy Dolovov 3bc744af35 [PL] Fix: Don't raise an error for unimplemented callables in external classes
^KT-57378
2023-04-25 08:00:14 +00:00
Dmitriy Dolovov e85406b561 [PL][tests] Learn PL test infra to work with JS files
^KT-57378
2023-04-25 08:00:14 +00:00
Dmitriy Dolovov b5ad5edc08 [PL][JS] Add test for handling external declarations
^KT-57378
2023-04-25 08:00:14 +00:00
Kirill Rakhman 4afc5315ca [FIR] Report missed diagnostics from FirSyntheticCallGenerator
#KT-58207 Fixed
2023-04-25 07:48:24 +00:00
Yan Zhulanow cb825f664f [LL API] Do not throw PCE on invalid sessions, patch specific cases
This is a temporary solution to fix the problem with sessions that
turned to be invalid at the time of analysis.

Currently, 'FirSession's and associated 'FirFile's are reused
between threads. When an exception, which might be an ordinary one
or 'ProcessCancelledException', occurs during an analysis of a module
file, a 'FirSession' for that module becomes invalid.

As there is currently a single resolution lock in the K2 IDE, other
threads might be waiting for resolution on the same session.
These threads are unaware that the session cannot be safely used
anymore, as it was correct before the lock.

The previous approach with cancelling analysis in all waiting threads
with manual 'ProcessCancelledException' throwing right inside the lock
showed it's incorrect. While some actions might be prepared to sudden
PCEs and can restart themselves, such behavior is not granted
by the platform.

The fix patches a few common places so the diagnostic list and
a file structure tree can be built safely. It is expected that in
some places exceptions caused by an inconsistent FIR tree can revive.

The right, ultimate fix to the problem involves modifying transformers,
so the FIR tree will mutate only when the analysis is complete. Although
it's planned work, it is expected to take quite a time.
2023-04-25 06:03:52 +00:00
Roman Golyshev e4390e47cf [Analysis API] KTIJ-23588 Do not ignore calls qualified with objects
^KTIJ-23588 Fixed
2023-04-24 22:16:55 +00:00
Nikolay Krasko 0aaaa5b4fa [213] Fix 1.5.10-release-949 jdk 8 stdlib requirement in :jps-common:test
ERROR:
:jps:jps-common:test: Could not find org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.10-release-949.

The problem is in dependency:
com.jetbrains.intellij.platform:jps-model-serialization:213.7172.25 -- (runtime) ->
com.jetbrains.intellij.platform:util:213.7172.25 -- (runtime) ->
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.10-release-949

Provide a jdk 8 stdlib that should make the resolution of the dependency
redundant.

KTI-1114
2023-04-24 21:58:31 +00:00
Yahor Berdnikau 3ee089bb48 Decouple KaptGenerateStubsTask from related KotlinCompile task configuration
This should simplify setup and remove task circular dependencies.

Generally users should not be affected by it unless they are configuring
 KotlinCompile task explicetly and expect the same configuration will be
  present on KaptGenerateStubsTask.

^KT-54468 In Progress
2023-04-24 18:32:07 +00:00
Yahor Berdnikau ee1517cd6a Decouple Kapt task from KotlinCompile task configuration
This fixes KotlinCompile task instantiation on configuring Kapt tasks
as well Kapt tasks itself eager realization.

Additionally this change removes circular dependency between kapt and
compilation tasks.

^KT-54468 In Progress
2023-04-24 18:32:07 +00:00
Ilya Goncharov e06606aa3f [Gradle, JS] Fix kotlin-gradle-plugin-npm-versions-codegen in codeowners 2023-04-24 17:12:19 +00:00
Dmitrii Gridin cb546926d5 [LL FIR] LLFirLazyResolveContractChecker: drop hack for COMPILER_REQUIRED_ANNOTATIONS phase
This is an obsolete hack

^KT-56543
2023-04-24 16:04:44 +00:00
Sebastian Sellmair 476c209bf4 [Gradle] Remove kotlinx.coroutines from KGP compile classpath
- Replace CompletableDeferred with a simple 'Completable'
- Replace withContext usage for 'withRestrictedStages' with custom
implementation

^KT-58162 Verification Pending
2023-04-24 15:45:24 +00:00
Ilya Goncharov 97d6b71654 [Gradle, JS] Remove unnecessary warning about multiple versions
^KT-56458 fixed

Merge-request: KT-MR-9747
Merged-by: Ilya Goncharov <Ilya.Goncharov@jetbrains.com>
2023-04-24 15:32:15 +00:00
Aleksei.Cherepanov 2e453051f9 Add cache comparator for incremental gradle tests
Add logic that rebuilds all sources after the last incremental round of each Gradle IC test and compares caches. The same was already implemented for JPS, but not for Gradle. After all rounds of incremental compilation are completed, another clean build from scratch is produced. All caches after the rebuild are compared with the caches of the last round of incremental compilation. This check is necessary because incremental compilation artifacts should depend on the state of the project, source files, and configuration, and not the chain of changes and incremental builds that led to this state. After the launch, there were several tests that did not satisfy the above conditions, and were muted  (KT-56681, KT-55195, KT-56242, KT-56698)

#KT-54991 In Progress
2023-04-24 14:54:45 +00:00
Aleksei.Cherepanov ae8428e8d0 Refactor Infrastructure of IC tests
1) Move root util functions to separate CompileRunnerUtils file from IncrementalJvmCompileRunner to leave the only class instance there and to separate util functions
2) Move TestLookupTracker from the abstract parent class location to a separate file as an implementation class
3) Small change naming of building functions just to clarify what they do
4) Some small code-style refactorings
2023-04-24 14:54:45 +00:00
Dmitrii Gridin 02abafd98d [FIR] do not request lazy resolve on isActual and isExpect for symbols 2023-04-24 14:47:21 +00:00
Kirill Rakhman 7f46225bed [FIR] Set correct constraint position for callable reference
This fixes a false positive resolution error for callable references
to functions with a type parameter that's annotated with
@OnlyInputTypes.

#KT-57994 Fixed
2023-04-24 14:04:50 +00:00
Dmitrii Gridin 89acaae819 [LL FIR] RawFirNonLocalDeclarationBuilder: improve diagnostics 2023-04-24 14:01:57 +00:00
Artem Kobzar 9bcfd093c5 [K/JS] Remove super keyword insertion if the body of method was moved into another place (private methods, lambdas, coroutines) ^KT-57990 Fixed 2023-04-24 13:54:36 +00:00
Pavel Kunyavskiy e63ed03d19 K2: Consolidate value parameter annotations handling in Fir2Ir
Value parameters annotations are now handled consistently in
factory functions creating this IrValueParameter instances.
In before, it was handled in several different places, which leads to
being sometimes lost, e.g. in LazyFirSimpleFunction.

This caused original problem in interop checks.

^KT-58099
2023-04-24 13:36:36 +00:00
Abduqodiri Qurbonzoda ad5593e68a [K/N] Mark Platform-related API with ExperimentalNativeApi
As part of stabilizing Native stdlib.
2023-04-24 13:29:02 +00:00
Alexander Udalov f04d01cf21 JVM IR: fix behavior of Enum.entries for unlowered enums
#KT-57671 Fixed
2023-04-24 12:43:43 +00:00
Alexander Udalov 449c866c7a JVM IR: minor, fix enum lowering kdoc
invokedynamic-based logic was removed in 562b27db4e.
2023-04-24 12:43:43 +00:00
Anton Lakotka 081e006006 [Gradle] Test that nullability is correctly inferred in metadata compilation
^KT-56380
2023-04-24 11:58:15 +00:00
Anton Lakotka 2137d26ce8 [Gradle] Test that extra jvm compilation can be created with java enabled
^KT-41506 Verification Pending
2023-04-24 11:58:15 +00:00
Dmitrii Gridin 2a00be916a [SLC] SymbolLightAccessorMethod: avoid symbol restoring on isValid
^KTIJ-25108 Fixed
2023-04-24 11:53:36 +00:00
Alexander Udalov 9ec78e1aa9 K2: remove JAVA_SHADOWED_PROTECTED_FIELD_REFERENCE error
This is a partial revert of 949a39b80f. In the end it turned out not
necessary to prohibit this case (and perform a breaking change), because
JVM backend was fixed to generate it correctly in d73d3c46e2.

 #KT-55307 Declined
 #KT-55846 Declined
2023-04-24 11:45:55 +00:00
Dmitrii Gridin 0ccae0d4c6 [SLC] unmute some tests 2023-04-24 11:42:06 +00:00
Jinseong Jeon 8544081c46 SLC: enable enum test case 2023-04-24 11:42:06 +00:00
Ilya Goncharov 5763acbd31 [Gradle, JS] Remove useCoverage fun
^KT-58199 fixed
2023-04-24 11:39:06 +00:00
Ilya Kirillov e32bcc2c83 Move IDE extension points from compiler.xml to the IDE repository
And remove `org.jetbrains.kotlin.moduleBuilder` as it's not used anymore

^KTIJ-25304 fixed
2023-04-24 09:25:13 +00:00
Dmitriy Novozhilov 2087a7c899 [FIR] Store generated declarations in the session component
Also extract generated declarations for classes from declaration site
  session, not use site

^KT-57821 Fixed
2023-04-24 09:22:30 +00:00
Dmitriy Novozhilov c6f5cf3e62 [FIR] Rename FirGeneratedClassDeclaredMemberScope.kt to FirGeneratedScopes.kt 2023-04-24 09:22:30 +00:00
Igor Chevdar 3e0196da89 [K/N][IR] Used liveness analysis in the coroutines lowering
Liveness analysis results are used for spilling variables before
suspending a coroutine
2023-04-24 09:57:16 +03:00
Igor Chevdar 4e661a6337 [IR] Liveness analysis
Compute actually used variables for specified IR nodes
2023-04-24 09:57:06 +03:00
Igor Chevdar 6a79163205 [K/N][IR] Extracted a common util function 2023-04-24 09:36:43 +03:00
Igor Chevdar cf58e5ff9f [K/N] Extracted some common BitSet utils 2023-04-24 09:36:43 +03:00
Anton Bannykh c839fdca3e [JS IR] initial support for KLIB incremental compilation with K2 2023-04-23 14:47:48 +02:00
Zalim Bashorov a9683bd4a8 Wasm: temporary force keeping Unit_getInstance in DCE 2023-04-22 17:41:23 +00:00
Zalim Bashorov 77491ded1b Use Array constructor with size to create Array of nulls
Change the constructor visibility from public to private as it should be.
2023-04-22 17:41:23 +00:00
Mads Ager a6520a294b [K2] Local property accessors are always default. 2023-04-21 23:40:41 +02:00
Mads Ager 3795fc1106 [K2] Fix stable parameter name metadata. 2023-04-21 23:40:41 +02:00
Mads Ager 3a8f1ca690 [K2] Type parameter metadata handling. 2023-04-21 23:40:41 +02:00
Mads Ager 73191ff9bc [K2] Add version requirement for definitely non-null types to metadata. 2023-04-21 23:40:40 +02:00
Mads Ager 1f3b8142a8 [K2] Enable tests for hasConstant field on properties in metadata. 2023-04-21 23:40:40 +02:00
Mads Ager f7171f01ae [K2] Enable tests for metadata for nested types. 2023-04-21 23:40:40 +02:00
Dmitrii Gridin 63e6816a50 [LL FIR] avoid body resolve on attempt to build symbol for type parameters
^KT-57850
2023-04-21 17:21:36 +00:00
Dmitrii Gridin 5a53d796e1 [LL FIR] add more tests on lazy resolve for type parameters
^KT-57850
2023-04-21 17:21:36 +00:00