Commit Graph

104893 Commits

Author SHA1 Message Date
Mikhail Glukhikh a77b758efa LV 2.0: drop reporting FIR_COMPILED_CLASS and relevant stuff
#KT-62056 Fixed
Related to KT-59171, KT-61951
2023-09-21 11:14:09 +00:00
Bogdan Mukvich d4640cb576 Remove repack_bundles.py script
* moved to build infrastructure scripts
2023-09-21 10:24:09 +00:00
Roman Efremov b232dbf484 [K2] Temporary mute ACTUAL_ANNOTATION_CONFLICTING_DEFAULT_ARGUMENT_VALUE
...until tests fixed. Mute on TC is not enough
because user projects compilation are affected.

^KT-62104
2023-09-21 09:05:51 +00:00
Bogdan Mukvich e705cd3dac SBOM for kotlin-dom-api-compat
^KTI-1243
2023-09-21 08:26:03 +00:00
Alexander.Likhachev 33df94d96e [Gradle] Fix mpp+kapt tests on Windows
Previously expected paths were defined with forward slash, however, on Windows the paths are transformed to use backslash.
2023-09-21 08:05:10 +00:00
Nikolay Lunyak 2801db0e59 [FIR] Unwrap substitution overrides for multiple default values
Otherwise, duplicate diagnostics may be reported on
subtypes of the type that actually declares the
problematic override.
2023-09-21 07:48:31 +00:00
Nikolay Lunyak 76fa812949 [FIR] Ensure K2 reports redundant diagnostics for default values 2023-09-21 07:48:31 +00:00
Nikolay Lunyak 8755cf75ac [FIR] Improve the messages of the multiple defaults diagnostics
Mention the base functions where the default
values come from.
2023-09-21 07:48:30 +00:00
Kirill Rakhman 4e1dfcd2a8 [FIR] Improve readability of rendered types in diagnostics
#KT-61824 Fixed
#KT-61688 Fixed
2023-09-21 07:18:19 +00:00
Kirill Rakhman 99b852adf8 [FIR] Refactor constructors of ConeTypeRenders 2023-09-21 07:18:19 +00:00
Kirill Rakhman da0308806a [FIR] Rename ConeTypeRendererWithJavaFlexibleTypes to ConeTypeRendererForReadability 2023-09-21 07:18:19 +00:00
Kirill Rakhman e996760e7e [FIR] Fix rendering of SUSPENSION_POINT_INSIDE_CRITICAL_SECTION
#KT-61826 Fixed
2023-09-21 07:18:19 +00:00
Kirill Rakhman ed4386a962 [FIR] Fix rendering of NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS 2023-09-21 07:18:19 +00:00
Kirill Rakhman 5c38289d60 [.idea] Add scope for testData and set file color to blue for it 2023-09-21 07:11:21 +00:00
Vladimir Sukharev c4221b0ec7 [MPP] Enable integration test "K2: Check native stdlib is not shadowed by commonMain stdlib metadata"
^KT-61645 Fixed


Merge-request: KT-MR-12243
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-09-21 06:57:58 +00:00
Yan Zhulanow 834cbaac5a [LL API] Run fir2ir separately for files in different modules
Each module may have its own compiler configuration.

^KTIJ-27061 Fixed
2023-09-21 06:19:15 +00:00
Dmitriy Dolovov 38a67f3d30 [KLIB] Use -Xmetadata-klib to produce metadata KLIBs
With this change a new `-Xmetadata-klib` CLI flag becomes the
preferable way to instruct K2MetadataCompiler to produce metadata
KLIBs. The old `-Xexpect-actual-linker` flag still works for
K2MetadataCompiler, but that would last just for a short transition
period until the necessary changes are made in the Gradle plugin.

The K2NativeCompiler does not work anymore with `-Xexpect-actual-linker`
and respects only the `-Xmetadata-klib` flag. This is not an
issue since the Gradle plugin anyway supplies both flags for Native
metadata compilations.

^KT-61136
2023-09-20 22:26:36 +00:00
Dmitriy Dolovov 848c88b1a5 [KLIB] Lift up -Xmetadata-klib CLI key from Native to Common args
This is a precondition for obsoleting and finally removing
`-Xexpect-actual-linker` CLI key, which became useless since
the removal of ExpectActualTable.

^KT-61136
2023-09-20 22:26:36 +00:00
Vladimir Sukharev 53f994263f Bump Kotlin/Native version in KGP to 1.9.30-dev-3695
Merge-request: KT-MR-12303
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-09-20 17:44:27 +00:00
Vsevolod Tolstopyatov d8a5d3e938 Introduce code_authoring_and_core_review.md
The corresponding rationale and the goals of the proposals can be found here: https://docs.google.com/document/d/1PWBlAvd1VTVoR0DLcf8At5qRTpG4--tGhLOdlOcS3H4


Co-authored-by: Simon Ogorodnik <Simon.Ogorodnik@gmail.com>


Merge-request: KT-MR-11375
Merged-by: Vsevolod Tolstopyatov <qwwdfsad@gmail.com>
2023-09-20 17:26:31 +00:00
Margarita Bobova f557236894 Verification metadata: allow 1.9.30 and 2.0.0 artifacts 2023-09-20 17:15:09 +00:00
Ivan Kochurkin 3cd4f7c3aa [FIR] Consider @PlatformDependent annotation everywhere (including JS and Native)
^KT-57858 Fixed

Remove FirEmptyOverridesBackwardCompatibilityHelper since it's not used anymore

Remove overridesMemberWithPlatformDependent.kt test file since it becomes redundant
2023-09-20 17:12:52 +00:00
Ivan Kochurkin 1026cdf035 [FIR] Register necessary resolve components for library session for all backends
^KT-61876 Fixed
2023-09-20 17:12:52 +00:00
Mikhail Glukhikh 1c6af76f61 Skip pre-release checks in FP tests 2023-09-20 15:57:54 +00:00
Mikhail Glukhikh eb3f785c36 K2: drop state mutation from ResolvedLambdaAtom init block
Related to KT-61933
2023-09-20 15:42:03 +00:00
Mikhail Glukhikh 770bbd8f6b K2: drop state mutation from LambdaWithTypeVariableAsExpectedTypeAtom init block
Related to KT-61933
2023-09-20 15:42:03 +00:00
Mikhail Glukhikh 14bc20652e K2: process also arguments while calculating postponed atoms
#KT-61933 Fixed
2023-09-20 15:42:03 +00:00
Mikhail Glukhikh 0c287c9945 K2: reproduce KT-61933 2023-09-20 15:42:03 +00:00
Roman Efremov ad4d1a5ba8 [IR] Support ACTUAL_ANNOTATION_CONFLICTING_DEFAULT_ARGUMENT_VALUE in K2
It's implemented as IR checker because in K2 constant expressions are
evaluated on backend. FIR diagnostic removed because isn't needed.

"annotationViaActualTypeAlias" test has no `// FIR_IDENTICAL` because
diagnostic reported on entire typealias declaration instead of its name.
This is because in IR+LightTree we have only offsets, so can't navigate
to typealias name element.

^KT-59940 Fixed
2023-09-20 15:40:37 +00:00
Roman Efremov ce666182a2 [IR] Refactor: extract util methods from IrExpectActualAnnotationMatchingChecker
They will be re-used in new checker in subsequent commit.

^KT-59940
2023-09-20 15:40:37 +00:00
Roman Efremov d4b8f73e04 [IR] Refactor: create new class for all IR expect-actual checkers
...to not write call of each checker inside IrActualizer.actualize.
This is needed because new IR checker will be addded in subsequent
commits.

^KT-59940
2023-09-20 15:40:37 +00:00
Sergej Jaskiewicz 88c308dfd3 [FIR generator] Don't print extra space in the where clause 2023-09-20 15:39:40 +00:00
Dmitrii Gridin 1d0785e246 [LL FIR] do not try to apply in-block modifications for unresolved bodies
In-block modifications are applicable only for FIR declarations with
fully resolved bodies. It can happen only during implicit type and body
phases. The implicit type phase probably is not applicable for our
particular case, but we will play safe because properties have a
complicated resolution logic, so it is hard to be sure that only body
phase will be enough.
Changes inside contracts are treated as out-of-block, so we can avoid
marker from this phase. Also, all mentioned calls inside bodies resolve
the corresponding declarations to the contract phase, so we will save a
lot with this optimization.

Q: Why in-block modification can be heavy?
A: In most cases this invalidation is pretty cheap because we have all
required information inside caches. But it is possible that we can
receive an in-block modification event for PSI without a corresponding
FIR element, or it is not yet fully resolved. In this case, for example,
we will do such redundant works as a raw FIR building or KtModule search

^KT-61842 Fixed
2023-09-20 15:36:02 +00:00
Dmitrii Gridin f7fe33bd98 [LL FIR] move in-block analysis declarations closer to service
^KT-61842
2023-09-20 16:04:03 +02:00
Dmitry Savvinov 0db4f464bb [gradle, kmp] Minor: add more info to deprecation message
Buildscripts that used `ios`-shortcut certainly used
`val iosMain by getting` as well, which will lead to Gradle exception
after migration. Mention in the diagnostic message that one should
replace `by getting` with static accessors

^KT-60734
2023-09-20 13:33:06 +00:00
Dmitriy Novozhilov e31ee1fa57 [FIR2IR] Get rid of builtin classes scope precaching
Previously it was required to generate fake-overrides for builtin classes
  beforehead, but during fix of KT-60924 it is no longer required

^KT-60924
2023-09-20 13:27:09 +00:00
Dmitriy Novozhilov 4e08cafc78 [FIR2IR] Get rid of IrSymbol.owner usages in Fir2IrLazyClass
^KT-60924
2023-09-20 13:27:09 +00:00
Dmitriy Novozhilov 5dbc0f12d1 [FIR2IR] Rename getIrEnumEntry to getOrCreateIrEnumEntry
This is needed for sake of naming consistency.
2023-09-20 13:27:09 +00:00
Dmitriy Novozhilov 3a9567ad45 [FIR2IR] Get rid of IrSymbol.owner usages in generation of delegated bodies in DelegatedMemberGenerator
^KT-60924
2023-09-20 13:27:09 +00:00
Dmitriy Novozhilov 4164c0f7ef [FIR2IR] Get rid of all usages of IrSymbol.owner from Fir2IrLazySimpleFunction
^KT-60924
2023-09-20 13:27:09 +00:00
Dmitriy Novozhilov 97005e5f78 [FIR2IR] Get rid of all usages of IrSymbol.owner from Fir2IrLazyPropertyAccessor
^KT-60924
2023-09-20 13:27:09 +00:00
Dmitriy Novozhilov 5b2fe7290b [FIR2IR] Move opt-ins to IrSymbolInternals closer to actual usages of symbol.owner
^KT-60924
2023-09-20 13:27:09 +00:00
Dmitriy Novozhilov 3778a69bf6 [FIR2IR] Replace getIrFieldSymbol with getOrCreateIrField in Fir2IrDeclarationStorage
Effectively, `getIrFieldSymbol` always created `IrField` if it was needed
  and returned its symbol. So to avoid potentially unsafe access of
  `IrFieldSymbol.owner` it's more convenient to return directly `IrField`

^KT-60924
2023-09-20 13:27:09 +00:00
Dmitriy Novozhilov e7b95d1288 [FIR2IR] Replace getIrClassSymbol with getOrCreateIrClass in Fir2IrClassifierStorage
Effectively, `getIrClassSymbol` always created `IrClass` if it was needed
  and returned its symbol. So to avoid potentially unsafe access of
  `IrClassSymbol.owner` it's more convenient to return directly `IrClass`

^KT-60924
2023-09-20 13:27:08 +00:00
Ivan Kochurkin 063835488f Revert "[FIR] Fix missing RETURN_TYPE_MISMATCH for labeled return statements"
This reverts commit 8e72f60996

Since some intellij tests are failing
2023-09-20 12:29:41 +02:00
Vladimir Sukharev e9d4de658d [FIR2IR] Don't emit empty body of while/do_while loop
Merge-request: KT-MR-12283
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-09-20 10:06:00 +00:00
Kirill Rakhman 5b4409e34c [FIR] Store abbreviated type in deserialized declarations as attribute
#KT-58542 Fixed
2023-09-20 09:31:29 +00:00
Ivan Kochurkin 8e72f60996 [FIR] Fix missing RETURN_TYPE_MISMATCH for labeled return statements
in lambda functions, ^KT-59907 Fixed
2023-09-20 09:06:37 +00:00
Kirill Rakhman 2e4d486131 [FIR] Use enhanced scope to guess array type in annotation loading
Otherwise, we return null for any java annotation because the
unenhanced scope doesn't contain any properties.

#KT-61856 Fixed
2023-09-20 08:02:37 +00:00
Dmitriy Dolovov c4da53475e [JS][tests] Drop obsolete EXPECT_ACTUAL_LINKER test directive
This directive was earlier used in KMP tests that were rewritten
and do not require this directive anymore.

^KT-61136
2023-09-20 07:54:36 +00:00