Commit Graph

109329 Commits

Author SHA1 Message Date
Vladimir Sukharev 80cf88c9b9 [K/N][Tests] Move threadStates tests to common codegen/box folder
^KT-61259
2024-01-16 20:15:25 +00:00
Sergey.Shanshin 96d7dc4fa6 [KxSerialization] Fixed access private custom serializer on property
When a custom serializer is specified on a type and this type is used in a property of another serializable class, then on the JVM this leads to an error accessing the custom serializer class - because it is private and located in another package.

Fixes https://github.com/Kotlin/kotlinx.serialization/issues/2495


Merge-request: KT-MR-12877
Merged-by: Sergei Shanshin <Sergey.Shanshin@jetbrains.com>
2024-01-16 20:04:17 +00:00
wrongwrong ab76f94aa7 Reflection: minor, fix obsolete comment
InlineAwareCaller has already been renamed.
2024-01-16 20:03:58 +00:00
Vladimir Tagakov ad9c100137 Sort class members in jvm-abi-gen
#KT-64589 Fixed
2024-01-16 20:03:29 +00:00
Alexander Udalov 1a46b053f2 jvm-abi-gen: minor, refactor debug info and body removing visitors
Co-authored-by: Vladimir Tagakov <vtagakov@lyft.com>
2024-01-16 20:03:29 +00:00
Pavel Kunyavskiy 2bf5a58a30 [Fir2Ir] Don't use FirSyntheticProperty as the cache key
^KT-64871
2024-01-16 19:14:52 +00:00
Mikhail Glukhikh c3c215b6a4 CallableId: return pathToLocal to constructor (KT-58739) 2024-01-16 18:26:41 +00:00
Sergej Jaskiewicz 731eeb020d [JVM] Don't rely on presence of signatures in JVM IR serialization tests
This patch should not change any reasonable testing behavior. The only
case when the behavior could be changed is when two different functions
have the same IdSignature, which is a problem on its own.

Required for KT-64809
2024-01-16 18:25:58 +00:00
Alexander Shabalin 7d35c1087e [K/N] Make GlobalData be initialized lazily ^KT-64313 2024-01-16 16:54:58 +00:00
Anastasia.Nekrasova 7429dd4b94 K2: Support for inter-module interaction for @SubclassOptInRequired
The inter-module interaction was partially supported, but the
DiagnosticCompilerTestFE10TestdataTestGenerated and
LFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated were
failing. This is because the arguments of annotations were not fully
resolved in loadExperimentalitiesFromAnnotationTo function.

^KT-60262 Fixed
2024-01-16 16:53:04 +00:00
Nikolay Lunyak d66b38b7a9 [FIR] Introduce FirPropertySymbol.initializerSource 2024-01-16 14:18:09 +00:00
Nikolay Lunyak f08c167729 [FIR] Introduce FirValueParameterSymbol.defaultValueSource
It's easier to read the code if you don't
see generic `fir` access and thus don't
need to check all its usages to make sure
it's used correctly.
2024-01-16 14:18:09 +00:00
Nikolay Lunyak cb89695e21 [FIR] Review symbol.fir in FirVisibilityQualifierChecker
Also introduce `firForVisibilityChecker`.
This way it's easier to use compared to
defining overloads in `FirVisibilityChecker`
that accept symbols.

This change exists, because I wasn't able
to make myself sure that accessing fir here
is safe. We may come here after a typealias
expansion, after all.
2024-01-16 14:18:09 +00:00
Nikolay Lunyak 0b7e8c4708 [FIR] Add unwrapFakeOverridesOrDelegated for symbols 2024-01-16 14:18:09 +00:00
Nikolay Lunyak c7d535ff46 [FIR] Introduce ownTypeParameterSymbols 2024-01-16 14:18:09 +00:00
Nikolay Lunyak 3afed72027 [FIR] Remove symbol.fir from FirNativeObjCOverrideInitChecker 2024-01-16 14:18:09 +00:00
Nikolay Lunyak 95989fc3e2 [FIR] Remove unneeded symbol.fir accesses 2024-01-16 14:18:09 +00:00
Nikolay Lunyak 965d8d2fd5 [FIR] Abstract away symbol.fir in FirImportsChecker
It's easier to reason about correctness of
`symbol.fir` when it's localized in small
helper functions.
2024-01-16 14:18:09 +00:00
Nikolay Lunyak 52d712e110 [FIR] Introduce memberDeclarationNameOrNull 2024-01-16 14:18:09 +00:00
Brian Norman eded51a0f5 [Parcelize] Detect redundant TypeParceler when type aliases are used
Make sure redundancies between class and property TypeParceler
annotations are detected when a type alias is used. This requires
checking the expanded type arguments of the annotation, as just
comparing the cone types is not sufficient because the type arguments
are not expanded.

^KT-64979 Fixed
2024-01-16 13:58:48 +00:00
Brian Norman 20340f94d4 [Parcelize] WriteWith Parceler type argument must be subtype of property
K2 checks that the entire Parceler of the WriteWith annotation is a
subtype of the expected Parceler for the property, while K1 only checks
that the type argument of the WriteWith Parceler is a subtype of the
property type. This mismatch leads to inconsistencies between K1 and K2
diagnostic reporting. Switch K2 to K1 behavior so diagnostics are
consistent.

^KT-60019 Fixed
2024-01-16 13:58:48 +00:00
Vladimir Sukharev be9805ea5e [K2/N][Tests] Add test to demonstrate compiler behavior for ObjC properties intersection overrides
^KT-57640
2024-01-16 13:40:51 +00:00
Pavel Kunyavskiy e6fd523431 [IrFakeOverrideBuilder] Consolidate visibility handling
Now fake overrides declarations invisible for override
are totally ignored by FakeOverrideBuilder, instead of
creating fake overrides for them, and than filtering them
out later.

As side-effect it fixes KT-64972.

^KT-64974
2024-01-16 13:35:16 +00:00
Yahor Berdnikau 104e6a9b7c [Gradle] Suppress documentation for warnNpmGenerateExternals
^KT-58858 In Progress
2024-01-16 12:36:29 +00:00
Vladimir Sukharev 5f51f5e1fc [K/N] Migrate more cinterop tests
^KT-61259
2024-01-16 11:58:31 +00:00
Ivan Kylchik 8ed7e31b5f [JVM] Validate lowered JVM IR only if it was explicitly requested
This is an addition to the f5bb477459
commit. Earlier, some of the validation checks were moved from
`stickyPostconditions` into separate lowering. But these
post-conditions checks were launched only when several flags were
set to true. In this commit, we just return to such behavior.

#KT-64116
2024-01-16 11:18:21 +00:00
Artem Kobzar a55c65e3e2 [K/Wasm] Add simple TypeScript definitions generating ^KT-65009 Fixed 2024-01-16 11:10:27 +00:00
Artem Olkov baa0748375 KT-64932: add support for no-package top level functions
Merge-request: KT-MR-13879
Merged-by: Artem Olkov <artem.olkov@jetbrains.com>
2024-01-16 10:58:51 +00:00
Ivan Kylchik 672c945895 [K2] Add test to check deprecation reporting from java static method
#KT-57785 Can't Reproduce
2024-01-16 10:56:31 +00:00
Dmitry Savvinov 8236fc245b [gradle, mpp] Clean-up dead code around metadata klib manifest handling
See the added source comment for details. This commit shouldn't change
any behavior of KGP

^KT-64525
2024-01-16 10:53:37 +00:00
Ivan Kylchik 5c28e63608 [K2] Forbid to do equality check with null in constant expressions 2024-01-16 09:57:53 +00:00
Ivan Kylchik 8cd9479f20 [K2] Report NON_CONST_VAL_USED_IN_CONSTANT_EXPRESSION when it is appropriate 2024-01-16 09:57:53 +00:00
Ivan Kylchik 0d127f6daf [K2] Properly check if binary logical expression is constant 2024-01-16 09:57:53 +00:00
Ivan Kylchik f8e9e99d87 [K2] Allow using simple boolean expressions in constant position
Such behavior is not the same as in K1, but it is more consistent.

#KT-64400 Fixed
2024-01-16 09:57:52 +00:00
Vladimir Sukharev 38ea2ce973 [K/N] Don't use assert in production code 2024-01-16 09:39:16 +00:00
Vladimir Sukharev 07938205bc [FIR][K/N] Get rid of SymbolInternals in FirObjCInterop 2024-01-16 09:39:16 +00:00
Vladimir Sukharev 37e9062fcc [FIR] Rename FirCallableDeclaration.getOverriddenSymbols() to getDirectOverriddenSymbols() 2024-01-16 09:39:16 +00:00
Vladimir Sukharev e109cac719 [FIR][K/N] Reduce use FIR internals usage in FirObjCInterop
^KT-61564
2024-01-16 09:39:15 +00:00
Vladimir Sukharev 55a41961d3 [FIR][K/N] Don't use FIR internals in FirNativeObjCOverrideInitChecker
^KT-61564
2024-01-16 09:39:15 +00:00
Sergej Jaskiewicz ad9f7bf90e [IR] Don't use the GET_PROPERTY origin on IrGetField expressions.
This origin was set somewhat arbitrarily.
It actually only makes sense for `IrCall`s to property getters.
There were no places in lowerings that checked `IrGetField` expressions
for this origin value.

^KT-62500 Fixed
2024-01-16 09:26:27 +00:00
Dmitriy Novozhilov f9ea353b60 [Native] Don't group K2 MPP tests in Native codegen tests
K2 in MPP compilation expects that it receives module structure
  with exactly one platform leaf module. This invariant may be broken
  during grouping tests, so MPP tests should be run in standalone mode
2024-01-16 09:01:32 +00:00
Dmitriy Novozhilov 1434d26d1b [Native] Minor. Slightly refactor FirNativeSerializer.kt 2024-01-16 09:01:32 +00:00
Dmitriy Novozhilov 3aa84906c2 [Native] Use proper session for fir metadata serialization
^KT-64743 Fixed
2024-01-16 09:01:32 +00:00
Kirill Rakhman 8c04206709 Revert "[FIR] Let attributes opt-in to participating in ConeClassLikeTypeImpl structural equality"
This reverts commit 9189154cae.
2024-01-16 09:14:22 +01:00
Kirill Rakhman 121536d2e5 Revert "[FIR] Don't lose error level enhancements in warning-level-enhanced arguments"
This reverts commit 371b1eb3d5.
2024-01-16 09:14:21 +01:00
Kirill Rakhman cf0824f3ef Revert "[FIR] Fix parameter order of NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS"
This reverts commit 8bfc4675c4.
2024-01-16 09:14:20 +01:00
Kirill Rakhman fa6ad41395 Revert "[FE 1.0] Fix new compilation warnings after #KT-63208"
This reverts commit dc0f4e6995.
2024-01-16 09:14:19 +01:00
Kirill Rakhman 77f83ce816 Revert "[kapt] Fix new compilation warnings after #KT-63208"
This reverts commit 9b4ebc31c1.
2024-01-16 09:14:18 +01:00
Kirill Rakhman 9fa889ed61 Revert "[FIR] Make EnhancedTypeForWarningAttribute a data class"
This reverts commit 76898ddb0f.
2024-01-16 09:14:18 +01:00
Iaroslav Postovalov 29c68c8aa7 [Tests] Add JavaAgainstKotlin tests for K2
^KT-64405 Fixed
2024-01-15 23:25:47 +00:00