Commit Graph

102693 Commits

Author SHA1 Message Date
Kirill Rakhman feed740415 [FIR2IR] Don't copy default value to annotation call with vararg parameter
This aligns the behavior with K1 and fixes an issue when the default
value was deserialized as FirExpressionStub leading to an exception
in FIR2IR when trying to convert it to an IR expression.

#KT-60120 Fixed
#KT-59610 Fixed
2023-07-17 11:42:39 +00:00
Leonid Startsev 7c1c01156f Add missing delegation in KmDeclarationContainerVisitor.visitExtensions for consistency 2023-07-17 11:04:18 +00:00
Leonid Startsev 20368a9e40 Enable explicit API mode for kotlinx-metadata(-jvm)
Most of the declarations are made public as-is, except for some reader implementation details
and MetadataExtensions.INSTANCES.

Also added missing delegation in KmDeclarationContainerVisitor.visitExtensions

#KT-59182 Fixed
2023-07-17 11:04:18 +00:00
Pavel Kunyavskiy 6da3ecceab [K/N] Implement frontend checkers for usages forward declaration type
Forward declaration type doesn't exist in runtime. This restricts
its possible usages.

^KT-59764
2023-07-17 09:24:33 +00:00
Nataliya.Valtman 27043bd8a6 Catch NoClassDefFoundError when BuildScanExtension is not found
Add simple test with init script

#KT-59589
2023-07-17 09:21:42 +00:00
Dmitrii Gridin 1642eaa48a [FIR] getValueClassUnderlyingParameters: fix TODO
^KT-53573 Obsolete
2023-07-17 08:59:17 +00:00
Sergej Jaskiewicz 5e63f7627f [klib] Test signature descriptions in irText tests
KT-59486
2023-07-14 20:26:45 +00:00
Sergej Jaskiewicz 6142d75bb4 [klib] Serialized mangled names of declarations along with signatures
^KT-59486 Fixed
2023-07-14 20:26:45 +00:00
Sergej Jaskiewicz 10aa5fc7ef [mangling] Add kdocs to some KotlinMangler methods 2023-07-14 20:26:45 +00:00
Sergey.Shanshin 5ba1b36796 [KxSerialization] Change visibility for synthetic functions
- synthetic constructor became internal for final classes
- write$Self became internal for final classes

Resolves https://github.com/Kotlin/kotlinx.serialization/issues/2209

Merge-request: KT-MR-9068
Merged-by: Sergey Shanshin <Sergey.Shanshin@jetbrains.com>
2023-07-14 17:36:22 +00:00
Justin Paupore 9f85739599 [AA] Add KtResolveExtensionInfoProvider to AA.
This provider is responsible for answering queries related to resolve
extensions. At the moment, this includes retrieving a KtScope with all REx
top-level declarations (moved from KtSymbolFromResolveExtensionProvider), and
retrieving information necessary to supply a GeneratedSourcesFilter for REx
generated code. Future REx-related functions can be added to this interface.

^KT-59329
2023-07-14 19:32:09 +02:00
Justin Paupore fa0209a322 [AA] Expand functionality of TestScopeRenderer.
- Add package and constructor listings
- Add single-scope renderForTests() implementation, including a lambda
  to provide additional information about each symbol
- Remove special handling for empty scopes (interfered with single-scope
  rendering)

^KT-59329
2023-07-14 19:32:08 +02:00
Justin Paupore f01b824751 [AA] Show symbol origins in REx tests.
This is in preparation for adding a separate KtSymbolOrigin for
resolve extension symbols.

^KT-59351
2023-07-14 19:32:08 +02:00
Justin Paupore 734b87b97e [AA] Allow specifying REx file contents in testdata.
Tests can now specify the code generated by a resolve extension from
within the test's testdata. Module-level directives control whether
resolve extensions are enabled for that module, as well as package names
and source shadowing regexes. File-level directives allow a `// FILE:`
block within the testdata to be converted into a KtResolveExtensionFile
and removed from the module as a whole. (This requires a new
`ModuleStructureTransformer`, because we need to be able to entirely
remove the files in question.)

Any test can add support for these directives by calling
`KtResolveExtensionTestSupport.configure` from within their
`configureTest` stanza. This allows this functionality to be used in
conjuction with any test base class.

^KT-59329
2023-07-14 19:32:08 +02:00
Mikhail Glukhikh 7a69f13fd6 K2: use unsubstituted scope to search for equals in FirDataFlowAnalyzer
#KT-60436 Fixed
2023-07-14 16:38:47 +00:00
Mikhail Glukhikh 00b4ae6ae9 K2: expand type before isSomeType checks properly
Related to KT-60229
2023-07-14 16:38:47 +00:00
Mikhail Glukhikh 51e8a72f47 K2: expand return type properly in FirReturnTypeChecker
#KT-60229 Fixed
2023-07-14 16:38:47 +00:00
Mikhail Glukhikh 402e1de5fe K2: reproduce KT-60229 2023-07-14 16:38:47 +00:00
Mikhail Glukhikh c350280e64 K2: fix enhancement building for Java methods with type parameters
Before this commit, we copied each type parameter during method
enhancement, while not copying the symbol. This led to symbol clashes
in MPP scenarios and various other problems.

Now we create a fully-functional type parameter copy in enhancement
and perform a substitution of old type parameters with new ones
in receiver type, value parameter types, return type,
and type parameter upper bounds.

#KT-59766 Fixed
#KT-59738 Fixed
2023-07-14 16:17:49 +00:00
Vladimir Sukharev 52068e11ee [K/N] Pass USE_FIR config setting to splitted first stage, and not to second stage
Merge-request: KT-MR-11084
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-07-14 15:23:27 +00:00
Dmitriy Novozhilov edc7df517c Revert "Advance bootstrap to 1.9.20-dev-6571"
This reverts commit 4797d30837.
2023-07-14 15:05:07 +00:00
Brian Norman d2ad426350 [FIR] Fix node ordering for delegating constructor graph
Inject delegated constructor and other in-place initializer sub-graphs
after the delegated constructor call node. This ensures property
initialization and use is calculated correctly when there are complex
calculations for the arguments to the delegated constructor.

#KT-59708 Fixed
#KT-59832 Fixed
2023-07-14 13:42:29 +00:00
Dmitriy Novozhilov 4797d30837 Advance bootstrap to 1.9.20-dev-6571 2023-07-14 12:59:56 +00:00
Sebastian Sellmair 3032d02ce9 [Gradle] Ide Dependency Resolution: Provide attributes for binary coordinates
^KT-60053 Verification Pending
2023-07-14 12:09:09 +00:00
Sebastian Sellmair 6140854fa6 [Gradle] IdeBinaryDependencyResolver: Do not link dependencies to 'isIdeaProjectLevel' by default
As this caching of dependencies would also require
to include the attributes (or name of the variant) into the coordinates

^KT-60053 Verification Pending
2023-07-14 12:09:09 +00:00
Sebastian Sellmair 041b424bab [Gradle] Ide Dependency Resolution: Provide capabilities for binary coordinates
^KT-60053 Verification Pending
2023-07-14 12:09:09 +00:00
Sebastian Sellmair 7af254fbf2 [Gradle] Implement IdeaKotlinBinaryCoordinates.displayString and identityString
^KT-60053 In Progress
2023-07-14 12:09:09 +00:00
Sebastian Sellmair e3f0fa4257 [Gradle] IdeaKotlinBinaryCoordinates: Include 'Capabilities'
... in order to differentiate between feature variants of
published libraries (e.g. testFixtures)

^KT-60053 In Progress
2023-07-14 12:09:09 +00:00
Sebastian Sellmair 9732651264 [Gradle] kgp-idea-proto: Automate protoc setup
^KT-60053 In Progress
2023-07-14 12:09:09 +00:00
Dmitriy Novozhilov 93c3bcbd74 [FIR2IR] Get rid of FirBasedSignatureComposer.withFileSignature 2023-07-14 11:04:27 +00:00
Dmitriy Novozhilov 80ae5f3ec7 [FIR2IR] Reformat FirBasedSignatureComposer
Move public methods to the top of the class
2023-07-14 11:04:27 +00:00
Dmitriy Novozhilov 45d9f9edf9 [FIR2IR] Split composeSignature method into three for different types of declarations
This is needed to avoid passing `containingClass` for non-callable
  declarations
2023-07-14 11:04:27 +00:00
Dmitriy Novozhilov a75d5353ee [FIR2IR] Get rid of forceTopLevelPrivate parameter in signature composer
Seems like it has no sense now
2023-07-14 11:04:27 +00:00
Dmitriy Novozhilov 5f36f80d25 [FIR2IR] Drop Fir2IrSignatureComposer
This interface had only one implementation, so all its usages were
  replaced with this implementation
2023-07-14 11:04:27 +00:00
Svyatoslav Kuzmich 2fd77d0925 [Wasm] IDL: Generate overloads for functions with union-typed arguments 2023-07-14 10:52:10 +00:00
Svyatoslav Kuzmich 24656b1576 [Wasm] Copy resolveTypes.kt from dukat
This file is modified later to generate overloads for union types
2023-07-14 10:52:10 +00:00
Svyatoslav Kuzmich c1100042b2 [Wasm] Use Unit in IDL event handler return type
Return value can be used in rare cases to stop event propagation.
Event methods can be called instead.

^KT-57058 Fixed
2023-07-14 10:52:10 +00:00
Sebastian Sellmair 5f00bfecff [Gradle] KotlinJvmTarget.withJava(): Disable java *Elements configurations and tasks
... as it was done before commit:

[Gradle] KotlinJvmTarget: Apply java-base plugin instead of java plugin for `withJava` Sebastian Sellmair* 22.06.23, 15:19
e47f4137f4

^KT-60388 Verification Pending
2023-07-14 08:15:05 +00:00
Sebastian Sellmair 625ce4c9db [Gradle] Implement regression test for KT-60388
^KT-60388 In Progress
2023-07-14 08:15:05 +00:00
Yahor Berdnikau 7b665e7673 [Gradle] Move UsesKotlinJavaToolchain inheritance into api
Such way it will be visible which tasks are using this feature.

^KT-58858 In Progress
2023-07-13 19:20:19 +00:00
Yahor Berdnikau 8988557b6d Update documentation for UsesKotlinJavaToolchain
^KT-58858 In Progress
2023-07-13 19:20:19 +00:00
Egor Kulikov 70d49999ac [FIR] Generate an error primary constructor when super call is invalid
Merge-request: KT-MR-11026
Merged-by: Egor Kulikov <Egor.Kulikov@jetbrains.com>
2023-07-13 17:37:48 +00:00
Alexander Korepanov a588e75c11 [JS IR] Optimize JS AST for closures
^KT-58891 Fixed
2023-07-13 16:37:18 +00:00
Alexander Korepanov 524c475834 [JS IR] Implement MoveTemporaryVariableDeclarationToAssignment optimization 2023-07-13 16:37:18 +00:00
Alexander Korepanov 25f7b81d51 [JS IR] Drop TemporaryAssignmentElimination optimization
Enable TemporaryAssignment tests
2023-07-13 16:37:17 +00:00
Roman Efremov a79282cec1 [FE] Prohibit actual typealias to certain compiler annotations
^KT-58554
2023-07-13 16:12:59 +00:00
Ivan Kochurkin f4a648aa3e [K2, MPP] Fix NO_ACTUAL_FOR_EXPECT reporting for all modules including the platform ones
^KT-58483 Fixed
2023-07-13 16:01:26 +00:00
Stanislav Ruban 4f92008f01 [test docs] Actualize the README.md for diagnostic tests somewhat 2023-07-13 13:41:36 +00:00
Stanislav Ruban 5c644bcac8 [test infra] Add a directive for type checking utils that use @Exact 2023-07-13 13:41:36 +00:00
Andrei Klunnyi 0323b0fb19 KT-59801 [FIR] scripting: tests for reference shortening 2023-07-13 15:21:39 +02:00