Commit Graph

109208 Commits

Author SHA1 Message Date
Svyatoslav Scherbina 23e558d172 Bump Kotlin/Native version in KGP to 2.0.0-dev-16829 2024-02-26 10:16:19 +00:00
Nikolay Lunyak 3b2bc598b5 [FIR] Reuse getNonSubsumedNonPhantomOverriddenSymbols
Just a small refactoring to avoid
duplicating comments.
2024-02-26 10:06:26 +00:00
Nikolay Lunyak 22fc90e5a1 [FIR] Treat properties from ObjC-classes as abstract
In short, the problem is some
platform libraries contain invalid
Kotlin code. Specifically,
some classes may inherit multiple
members with default
implementations, but do not define
an explicit override, like `UIView.bounds`.

Since we can't refactor platrofm
libraries just now, we want to
treat such properties as abstract.

^KT-65866 Fixed
^KT-65855
2024-02-26 10:06:26 +00:00
Andrey Yastrebov 2ae8d28b33 KT-65582 Swift export XCTest integration tests 2024-02-26 09:57:12 +00:00
Andrey Yastrebov 6146a59636 KT-65582 Swift export build integration tests 2024-02-26 09:57:12 +00:00
Andrey Yastrebov 444dc790db KT-65582 Extract xcode simulator test helpers 2024-02-26 09:57:12 +00:00
Andrey Yastrebov 6ed6e7ce28 KT-65582 Add Swift export test tags 2024-02-26 09:57:12 +00:00
Nikolay Lunyak f1c7f929d2 [FIR] Don't miss diagnostics on resovled reified type parameters
^KT-66005 Fixed
2024-02-26 09:53:13 +00:00
Nikolay Lunyak b0e6db7807 [FIR] Reproduce KT-66005
^KT-66005
2024-02-26 09:53:13 +00:00
Dmitriy Novozhilov eb85caedad [FIR] Search for typealias in dependencies, if expect class was found first
^KT-65840 Fixed
2024-02-26 09:25:57 +00:00
Kirill Rakhman c3c2f6f90a [FIR] Don't set lambda parameter type to Nothing by default
... when the expected type is not a function type.
Instead set it to a new type variable.
This fixes a bunch of false negative CANNOT_INFER_PARAMETER_TYPE.

#KT-59882 Fixed
2024-02-26 08:59:22 +00:00
Dmitriy Novozhilov 9857bdc891 [FIR2IR] Unwrap typealiases during applying of suspend conversion
^KT-65002 Fixed
2024-02-26 08:56:24 +00:00
eugene.levenetc 83ddf904aa [ObjCExport] Fix data class predefined methods translation
KT-65800
2024-02-25 21:31:30 +00:00
Anton Lakotka 3e5afcaaba [Gradle] Setup Consistent metadata dependencies resolution
Configure consistent metadata resolution only for source sets that
participate in metadata compilation. i.e. test or any other extra
compilations should be excluded.

^KT-65954 Verification Pending
^KT-66047 Verification Pending
2024-02-25 20:59:03 +00:00
Anton Lakotka c027ba642f [Gradle] Introduce SourceSetDependenciesResolution dsl for tests
It allows to mock published via gradle libraries to verify
dependency resolution correctness.
2024-02-25 20:59:03 +00:00
Anton Lakotka 46abf63796 [Gradle] Compare resolved components ignoring versions for source sets
Source Set Visibility algorithm relies on the match between metadata
dependencies resolution and platform dependencies resolution. However
there is a chance that they don't match in versions.
i.e. commonMain resolved into 1.0 but jvmMain got 2.0 of the same
library. However this discrepancy is not correct after all. And
both metadata compilations and platform compilations should see the same
set of libraries. This behavior will be fixed in KT-66047

^KT-65954 Verification Pending
2024-02-25 20:59:03 +00:00
Anton Lakotka 32be35051d [Gradle] Test that metadata compilation for bug KT-65954 doesn't fail
Metadata compilation should not fail when test source set has
dependency with higher version

^KT-65954 Verification Pending
2024-02-25 20:59:03 +00:00
Nikita Bobko c31a72a4af [FIR] Switch FirExpectActualDeclarationChecker to Platform checker
^KT-66028 Fixed
2024-02-25 18:18:55 +00:00
Nikita Bobko 4c602585b0 [FIR, IR] Cleanup: drop unused allowClassActualizationWithWiderVisibility & allowTransitiveSupertypesActualization
These flags were used when ExpectActualMatchingContext was reused in K1.
2024-02-25 18:18:55 +00:00
Jaebaek Seo 171ea3571c K2: Use deserialized type annotation for lambda type resolution.
This commit adds code to check whether a deserialized cone type is a
special function type kind or not when resolving the type of a lambda
expression (anonymous function). If it is a special function kind, it
sets the type of lambda based on the special function kind.

^KT-64994 Fixed
2024-02-25 10:10:43 +00:00
Jaebaek Seo 10a422180a K2: Propagate annotation of function type kind in compose plugin
We want to test whether the propagation of function type kind annotation
correctly works or not. This commit updates
ComposableFunctionsTransformer that mimics the real compose compiler
plugin to propagate the composable annotation i.e., @MyComposable from
MyComposableFunction kind. Finally, the generated IR function for lambda
expression must have the composable annotation, when the lambda
expression does not have the explicit composable annotation, but we
infer the composable annotation based on the annotation of function type
for the value parameter.

^KT-64994
2024-02-25 10:10:43 +00:00
Jaebaek Seo 512efb9649 K2: Support binary library dependencies between test modules
The test infrastructure for analysis supports binary module tests, but
the binary build does not use another binary module as a dependency when
it passes the class path. As a result, each binary module build does not
work when they have dependency on each other.

This commit fixes the issue by
1. Topological sort in the order of dependency graph for test modules.
2. Pass module paths as extra class paths when they have dependency on
   each other.

^KT-64994
2024-02-25 10:10:43 +00:00
Nikita Nazarov 407448d8e3 [JVM] Implement new inlined variable naming format
^KT-65478 fixed
2024-02-23 23:59:13 +01:00
Ilya Chernikov 9ea775cbed K2 scripting: fix containing decl for last script expression
Generally the wrapping anonymous initializer can be used as a
"containing declaration" for some elements, but since the initialiser
for the last script expression could be dropped (the expression could
be converted to the result property), this may lead to the surprises,
e.g. as described in KT-65984
This fix marks the last initialiser as local, preventing it from being
referenced as "containing declaration".

#KT-65984
2024-02-23 22:03:44 +00:00
Ilya Chernikov 0c5b700523 K2: fix annotation search on supertypes in assignment plugin
Current implementation checks only immediate supertype, while
in case of gradle build scripts DSL, the annotated superclass
is located deeper in the hierarchy.
The fix implements a recursive supertype check.

#KT-65983 fixed
2024-02-23 22:03:44 +00:00
Ilya Chernikov eab5164993 Scripting: fix script lowering in case of out of order declarations
The problem was that in K2 for some top-level script declarations we
need to add a dispatch receiver parameter (because frontend do not
assign any, but representing script as a class requires it to be the
script class) and at the same time, calls to these declarations rely on
properly set dispatch receiver parameter.
The simplest solution found is to have an additional traversal on the
relevan top-level declarations and assigning the dispatch receiver,
before running the main transformation.

#KT-64502 fixed
2024-02-23 22:03:44 +00:00
Ilya Chernikov 266447120d K2 scripting: treat default import similarly to K1
namely, add them to importing scopes directly and according to the
schema used for other implicit imports, rather than adding them
to the regular script file imports. See KT-65982 for explanation.
#KT-65982 fixed
2024-02-23 22:03:44 +00:00
Ilya Chernikov 9037975758 K2 Scripting: Skip base class params from resolution scope
The base class in scripting considered obsolete and therefore supported
via some ad-hoc mechanisms. In particular parameters to the base class
c-tor are passed via script provided properties. But in combination
with the resolution logic, this leads to issues described in KT-60452
This commits filters out such parameters from script resolution
scope and avoids this problem for now.
Bot it should be noted that proper diagnostics for properties shadowing
should still be implemented - see #KT-65809
#KT-60452 fixed
2024-02-23 22:03:44 +00:00
Ilya Chernikov 49559d2a5a K2 Scripting: fix implicit receivers resolution order
#KT-65975 fixed
2024-02-23 22:03:44 +00:00
cristiangarcia 1847485d28 Make maven publishing CC compatible
Required for KTI-1553
2024-02-23 18:27:11 +00:00
Pavel Kunyavskiy c991535756 [IRFakeOverrides] Fix accessors visibilities
^KT-65801
2024-02-23 16:35:27 +00:00
Sergej Jaskiewicz acee8da283 [IR] Move coroutine-related helpers to a more appropriate place
The `isBuiltInSuspendCoroutine` and
`isBuiltInSuspendCoroutineUninterceptedOrReturn` helpers are not
inherently related to function inlining.
2024-02-23 16:26:55 +00:00
Sergej Jaskiewicz 919abe483a [JVM IR] Move CachedSyntheticDeclarations to backend.common
This will allow us to use this class in KLIB-based backends (KT-64865)
2024-02-23 16:26:55 +00:00
Sergej Jaskiewicz 25be39dcc6 [JVM IR] Factor out JVM-specific logic from CachedSyntheticDeclarations
This will allow us to use this class in KLIB-based backends (KT-64865)
2024-02-23 16:26:55 +00:00
Sergej Jaskiewicz d137594c77 [JVM IR] Remove JvmLoweredDeclarationOrigin.SYNTHETIC_MARKER_PARAMETER
There is already a similar origin
`IrDeclarationOrigin.DEFAULT_CONSTRUCTOR_MARKER`
2024-02-23 16:26:55 +00:00
Sergej Jaskiewicz 4325803262 [JVM IR] Move SYNTHETIC_ACCESSOR origin to IrDeclarationOrigin.Companion
We want to generate synthetic accessors not only on JVM (KT-64865),
so this is one of the prerequisites.
2024-02-23 16:26:55 +00:00
Sergej Jaskiewicz 86587a3bf2 [JVM IR] Add KDocs for methods related to synthetic accessor generation 2024-02-23 16:26:55 +00:00
Sergej Jaskiewicz 524dd6794a [JVM IR] Use KDoc in JvmSymbols i/o regular comments when possible 2024-02-23 16:26:55 +00:00
Sergej Jaskiewicz 4f44d32cc2 [JVM IR] Avoid hard-coded checks for coroutine intrinsics
Use existing helpers for that instead, and introduce a new one.
2024-02-23 16:26:55 +00:00
Dmitriy Novozhilov ebeba231a0 [FIR2IR] Slightly cleanup FakeOverrideGenerator 2024-02-23 16:26:05 +00:00
Dmitriy Novozhilov ef8f954586 [FIR2IR] Part 7. Don't use IdSignature for code fragments
Related to KT-64990
2024-02-23 16:26:05 +00:00
Dmitriy Novozhilov 7aa99a97d9 [FIR2IR] Part 6. Delete FirIrProvider
`IrProvider`s are used to bind unbound symbols which are left after IR
  construction. fir2ir doesn't leave any unbound symbols in the tree,
  so there is actually no need in FirIrProvider at all
2024-02-23 16:26:05 +00:00
Dmitriy Novozhilov aba1e587c4 [FIR2IR] Part 5. Cleanup Fir2IrClassifierStorage API (type aliases) 2024-02-23 16:26:05 +00:00
Dmitriy Novozhilov fb4b14e250 [FIR2IR] Part 4. Cleanup Fir2IrClassifierStorage API (enum entries)
^KT-65937 Fixed
2024-02-23 16:26:05 +00:00
Dmitriy Novozhilov e340286606 [FIR2IR] Part 3. Don't create type parameter symbols with signature
^KT-64990
2024-02-23 16:26:05 +00:00
Dmitriy Novozhilov d0c9353d41 [FIR2IR] Part 2. Don't create class symbols with signature
Signature calculation was already disabled for almost all cases in the
  scope of KT-64990
2024-02-23 16:26:05 +00:00
Dmitriy Novozhilov 9c21c2214a [FIR2IR] Part 1. Cleanup Fir2IrClassifierStorage API (classes)
This commit cleans up API related to referencing classes and their symbols,
  to make it more similar with similar API in Fir2IrDeclarationStorage
2024-02-23 16:26:05 +00:00
Dmitriy Novozhilov 3bf0a11ced [Test] Reproduce KT-65937 2024-02-23 16:26:05 +00:00
Evgenii Mazhukin cc2dcf0078 [JPS][IC] Register lookups as usages in jps dependency graph
^KT-65429 In Progress


Merge-request: KT-MR-14485
Merged-by: Evgenii Mazhukin <evgenii.mazhukin@jetbrains.com>
2024-02-23 16:08:29 +00:00
Sebastian Sellmair 85cfa252c3 [CODEOWNERS] Add 'Kotlin in Fleet' as codeowner for ':kotlin-tooling-core' 2024-02-23 15:48:47 +00:00