Commit Graph

106417 Commits

Author SHA1 Message Date
Svyatoslav Kuzmich b3bc99a44a [Build] Use impl dependencies for compiler.common.{web,wasm}
Refactor build scripts to use implementation dependencies instead of api
for finer grained recompilations.
2023-11-23 15:52:55 +00:00
Ivan Kochurkin a04deba7c7 [FIR] Fix compiler crash with incorrect argument in FirDanglingModifierList
KT-63508 Fixed
2023-11-23 15:25:44 +00:00
Tatiana Bogdanova fc5239bdfd Add changelog for 1.9.21 2023-11-23 14:36:56 +00:00
Kirill Rakhman 11ab90ecbd [Tests] Add regression test for #KT-63732 2023-11-23 14:24:47 +00:00
Kirill Rakhman 9ea4afe7c8 [FIR] Fix isValidTypeParameterFromOuterDeclaration check for local class
This fixes an IllegalArgumentException when
symbolProvider.getClassLikeSymbolByClassId is called with a local
class ID.

#KT-63656 Fixed
2023-11-23 14:24:47 +00:00
Marco Pennekamp a703f5afb8 [LL] Use emptyMap() for empty FileStructureElementDiagnosticLists
- This improves the memory usage of `FileStructureElementDiagnosticList`
  by avoiding lots of duplicate empty mutable maps. We can assume that
  most diagnostics lists are empty, since code is usually green.
- I tested the memory consumption manually by opening all files in
  `org.jetbrains.kotlin.idea.k2.codeinsight.inspections` and waiting for
  analysis to finish for each file. With the change, the retained size
  of `FileStructureElementDiagnosticList` shrank from 63.39kB to
  13.77kB.
2023-11-23 14:00:43 +00:00
Sebastian Sellmair 59c4c83ed5 [K/N] Samples: Update samples default Kotlin version to 1.9.20 2023-11-23 13:19:04 +00:00
Sebastian Sellmair 359f5fe7b3 [K/N] Samples: Migrate 'echoServer' to modern multiplatform
^KT-50547 Fixed
2023-11-23 13:19:04 +00:00
Anastasia.Nekrasova 97ef2de6e3 [K2] OPT_IN_USAGE_ERROR is absent when calling the enum primary constructor
^KT-63459
2023-11-23 13:16:05 +00:00
Anastasia.Nekrasova c6d391c632 [K2] OPT_IN_MARKER_CAN_ONLY_BE_USED_AS_ANNOTATION_OR_ARGUMENT_IN_OPT_IN on an annotation import
Only tests added

^KT-59582
2023-11-23 13:14:42 +00:00
Roman Efremov fa20eb73f2 [Tests] Don't ignore expected file if diagnostic output is empty
Because of this, `checkDiagnosticFullText.fir.diag.txt` was
obsolete, because nothing was reported, but test was green.

^KT-62559
2023-11-23 12:17:34 +00:00
Roman Efremov fcc6f873c7 [FIR] Prevent reporting ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT twice in CLI
It is duplicated because we have two checkers: FIR (for IDE support
in simple cases) and IR ("honest" checker supporting all cases).
Fix this by running FIR checker only in IDE.

FIR checker behavior remains covered by tests in
`LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated`.

^KT-62559 Fixed
2023-11-23 12:17:34 +00:00
Roman Efremov a466b14264 [FIR] Refactor: extract ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT checker
...into separate object.

^KT-62559
2023-11-23 12:17:34 +00:00
Svyatoslav Kuzmich 3e88fc80d2 [AA] Regenerate AA after moving diagnostics from js to web.common 2023-11-23 10:42:57 +00:00
Svyatoslav Kuzmich cf3b293072 [Wasm] Move external RTT checkers to web.common and reuse in Wasm
#KT-56849
2023-11-23 10:42:56 +00:00
Svyatoslav Kuzmich d219d5380b [Wasm] Move FirJsQualifierChecker to web.common and reuse in Wasm
#KT-56849
2023-11-23 10:42:56 +00:00
Svyatoslav Kuzmich 640bf67480 [Wasm] Move FirJsExportAnnotationChecker to web.common and reuse in Wasm
#KT-56849
2023-11-23 10:42:56 +00:00
Svyatoslav Kuzmich c1fa0a3e8c [Web] Move common ids from WasmStandardClassIds to WebCommonStandardClassIds 2023-11-23 10:42:56 +00:00
Svyatoslav Kuzmich 910835af2d [Web] Add core/compiler.common.web module
Add WebCommonStandardClassIds object to use in JS&Wasm shared code
2023-11-23 10:42:56 +00:00
Stanislav Ruban ec995fc847 [tests] Regenerate configurations for box-tests 2023-11-23 09:34:15 +00:00
Stanislav Ruban 9956c0f83b [tests] Cover KT-63654 with test cases 2023-11-23 09:34:14 +00:00
Anastasia.Nekrasova 6471080c48 [K2] Disappeared UNSUPPORTED
Mark as UNSUPPORTED suspension points in default parameters

^KT-59881
2023-11-23 09:29:07 +00:00
Brian Norman c1f6fe1e76 [FIR] Do not include transitive friend dependencies in symbol provider
When flattening a dependency FirSymbolProvider, make sure transitive
dependency FirSymbolProviders are not included. This requires checking
that nested symbol provider sessions match the composite symbol provider
session when they are both source sessions.

^KT-60614 Fixed
2023-11-22 19:43:24 +00:00
Artem Kobzar 33ab1871c7 [K/JS] Fix coroutines but turn back the fix for coroutines intrinsics intercepted and releaseIntercepted 2023-11-22 18:10:08 +00:00
Ilya Gorbunov d8ee74222f [builtins-gen] Explicit visibility for companion objects and secondary constructors 2023-11-22 18:04:34 +00:00
Ilya Gorbunov ab7c2f2196 [stdlib] Explicit visibility and return types: builtins 2023-11-22 18:04:34 +00:00
Ilya Gorbunov df190b1265 [stdlib] Explicit visibility and return types: JVM internal 2023-11-22 18:04:34 +00:00
Ilya Gorbunov 2e030f213b [stdlib] Explicit visibility and return types: JVM 2023-11-22 18:04:34 +00:00
Ilya Gorbunov c77930c1ea [stdlib] Explicit visibility and return types: Native 2023-11-22 17:57:40 +00:00
Egor Kulikov 43fc4ccf40 [FIR] Source for implicit iterator calls in for should not be null
^KT-62111 fixed


Merge-request: KT-MR-13029
Merged-by: Egor Kulikov <Egor.Kulikov@jetbrains.com>
2023-11-22 17:15:24 +00:00
Roman Efremov 6a90926e2e [K2] Support reporting of IMPLEMENTATION_BY_DELEGATION_IN_EXPECT_CLASS
^KT-59983
2023-11-22 16:40:06 +00:00
Alexander Korepanov bf54fda8ec [JS Test] Add a test case
Add a test case for a suspend lambda
with a user-defined value class.

^KT-62077 Fixed
2023-11-22 16:29:54 +00:00
Roman Golyshev 347d51c90e KTIJ-27879 [AA] Enforce lazy resolve of code fragments in ContextCollector
Without it, the lazy body of code fragment is not properly resolved
and cannot be analyzed

Use the correct function from `BodyResolveContext` to take the scopes
from code fragment into account

^KTIJ-27879 Fixed
2023-11-22 16:29:28 +00:00
Sergej Jaskiewicz 8eefb210f9 [FIR/IR generator] Introduce the shared Model class 2023-11-22 15:10:16 +00:00
Sergej Jaskiewicz 9a11208e67 [FIR/IR generator] Extract visitFunctionName to AbstractElement 2023-11-22 15:10:16 +00:00
Sergej Jaskiewicz 8ba42a7ff2 [IR generator] Use Element#typeName i/o Element#name where needed
This slightly reduces repetition.
2023-11-22 15:10:16 +00:00
Sergej Jaskiewicz 6ac4cd5973 [IR generator] Get rid of the config model
In the IR generator, we had a so-called `ConfigModel` with classes like
`ElementConfig` and `FieldConfig` that we deal with during
tree configuration in `IrTree.kt`, and another kind of model called
just `Model` that included the `Element` and `Field` classes
correspondingly. Those were used for actual code generation.
After configuration, `ConfigModel` was transformed to `Model` and
then the code generation was performed using `Model`.

This architecture is overly complicated and results in massive code
duplication. Most `ElementConfig` and `FieldConfig` properties had
exactly the same counterparts in `Element` in `Field` classes.

So, if you wanted to add a new feature to the tree generator, you had to
add a property to both `ConfigModel` and `Model`.

Turns out we can do just fine with only one kind of model.
2023-11-22 15:10:16 +00:00
Ilmir Usmanov 37417f7919 KAPT: Use reflection to access code, changed in JDK 21
#KT-57389 Fixed
2023-11-22 14:58:55 +00:00
Ilmir Usmanov 4f7c96ae43 KAPT: Always print parens on empty annotation parameters
Since JDK 17+ pretty-printer does not print parens on empty annotation
parameters, print them anyway. Otherwise, tests with annotations differ
on different JDKs.
 #KT-57389
2023-11-22 14:58:55 +00:00
Ilmir Usmanov 87aed4bf47 KAPT: Run tests on JDK 21
Previously, some tests have also been disabled on JDK 11+, since
we did not filter out empty filesets, which led to failed assertion
inside JDK.
 #KT-57389
2023-11-22 14:58:55 +00:00
Ivan Kylchik c82bc8f0ce [WASM] Add ConstEvaluationLowering to the lowering list 2023-11-22 14:54:19 +00:00
Nikolay Lunyak 427c067cd8 [FIR] Forbid typeRef-named labels without +ContextReceivers
^KT-63068 Fixed
2023-11-22 13:22:45 +00:00
Ivan Kylchik e7a3cd638e [JVM_IR] Don't generate reflective access to getter/setter without property
This is the case when we have Java class in hierarchy. In this case,
we want to generate reflective access to the original Java method.

#KT-63642 Fixed
2023-11-22 12:17:01 +00:00
Ivan Kylchik 57d912a5d4 [JVM_IR] Don't use plugin extensions when compiling code fragment
When compiling code fragment, we forbid to use `irLinker` as
IR provider. Because of that, if there are some plugin
extensions, we will not be able to find deserializer
for a given module and will fail.

#KT-63695 Fixed
2023-11-22 11:56:08 +00:00
Nataliya.Valtman 6bbf5b83c8 Add compiler metrics to JPS build report
#KT-63549: Fixed
2023-11-22 11:30:08 +00:00
Vladimir Sukharev 6cff71e7d1 [K/N] Add objc-related clang options to cinterop executable tests
^KT-63287
2023-11-22 11:18:09 +00:00
Dmitrii Gridin d450c1e91f [LL FIR] encapsulate FileAnnotationContainer resolution logic
As a file annotation container is required for resolution,
it should be closer to the resolution logic. Now only LLFirTargetResolver
will operate this logic, so we can change the logic in the future without
a big refactoring.
E.g., as the next step, this resolution can be integrated to the file

^KT-63042
2023-11-22 11:02:09 +00:00
Dmitrii Gridin bc1e9fd2ea [LL FIR] LLFirTargetResolver: introduce resolveDependencyTarget step
This entry point is required to be able to pre-resolve dependency
declarations.
E.g., fake override declaration shares annotation instances between
the original and the fake one, so we should resolve the original
firstly to avoid concurrent modification and correct context.
This will be done later.

This commit effectively only drops body resolution for a file annotation
container if the target element is not a file because this
is not required for correct resolution

^KT-63042
2023-11-22 11:02:09 +00:00
Dmitrii Gridin 0b07b86ec9 [FIR] make FirLazyDeclarationResolver FirElementWithResolveState-based
This is required to be able to call lazy resolve for FirFileAnnotationsContainer

^KT-63042
2023-11-22 11:02:09 +00:00
Sergej Jaskiewicz d7710b8e8d [FIR generator] Remove redundant full qualifier in generated builders 2023-11-22 10:00:06 +00:00