Commit Graph

44457 Commits

Author SHA1 Message Date
Sergej Jaskiewicz 10aa5fc7ef [mangling] Add kdocs to some KotlinMangler methods 2023-07-14 20:26:45 +00: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
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 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
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
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
Dmitrii Gridin b67b37cdb3 [FIR] FirJavaFacade: do not duplicate record constructor
The fresh version of intellij has all record-related declarations,
so an additional fake constructor leads to errors like
KTIJ-25364 (OVERLOAD_RESOLUTION_AMBIGUITY)

^KTIJ-25366 Fixed
^KTIJ-25364 Fixed
^KTIJ-25368 Fixed
^KTIJ-25370 Fixed
2023-07-13 09:21:38 +00:00
Dmitrii Gridin 97a12af03e [FIR] fix publication race in fakeOverrideSubstitution
Problem: fakeOverrideSubstitution was set to null before the return
type was published, so another thread can see a state where
fakeOverrideSubstitution is null and a return type is implicit
simultaneously

^KT-60385
^KT-59758 Fixed
2023-07-13 09:17:08 +00:00
Mikhail Glukhikh 17da09bf17 K2: add ConeKotlinType argument for NULL_FOR_NONNULL_TYPE 2023-07-13 09:07:39 +00:00
Mikhail Glukhikh 9d9d7880af K2: render types in quotes in diagnostic messages 2023-07-13 09:07:39 +00:00
Mikhail Glukhikh c839cd3c11 K2: don't use debugging type renderer in error messages 2023-07-13 09:07:39 +00:00
Roman Efremov 4a598afc36 [FE] Prohibit expect or actual opt-in annotations
^KT-58554
2023-07-13 08:15:42 +00:00
Denis.Zharkov 54962d5ec3 K2: Simplify FirDeclarationsResolveTransformer.transformAccessor
WithExpectedType mode was only needed to replace return type for the
getter, so I made it explicit there

After that, `resolutionMode` in `transformFunctionWithGivenSignature`
became effectively constant
2023-07-12 17:28:44 +00:00
Denis.Zharkov 8cee2c36d3 K2: Get rid of enhancedTypeRef concept in property accessors
As it's always equal to the latest value at `property.returnTypeRef`
2023-07-12 17:28:43 +00:00
mvicsokolova d9fa9c1b3b [K/N] Introduce intrinsics that atomically update array elements
Supported atomic update of elements for IntArray, LongArray and Array<T>
See KT-58360

Merge-request: KT-MR-11020
Merged-by: Maria Sokolova <maria.sokolova@jetbrains.com>
2023-07-12 14:32:36 +00:00
Ivan Kochurkin 20c53fc15d Unify JvmSignatureSerializer 2023-07-12 13:11:25 +00:00
Ivan Kochurkin 4d24a8b40c [FIR] Remove duplicated code discovered by running inspection 2023-07-12 13:11:25 +00:00
Ivan Kochurkin 1a28067b76 [FIR] Merge FirBasedKotlinMangler into FirMangler
FirMangler has only one implementation and it's FirBasedKotlinMangler

It looks excessive
2023-07-12 13:11:24 +00:00
Ivan Kochurkin ca93165044 [FIR] Remove useless code discovered by code coverage 2023-07-12 13:11:24 +00:00
Pavel Mikhailovskii 9486d966dc [FIR] Keep slashes in FirJvmTypeMapper.Context.getClassInternalName 2023-07-12 13:06:00 +00:00
Dmitrii Krasnov f2816a5531 Added property for overriding konan distribution location
#KT-50463 Fixed

Merge-request: KT-MR-10310
Merged-by: Dmitrii Krasnov <Dmitrii.Krasnov@jetbrains.com>
2023-07-12 12:36:51 +00:00
Brian Norman 10ed26991d [FIR] Extract LHS receiver of assignment operator statements
#KT-53490 Fixed
2023-07-12 11:41:33 +00:00
Timofey Solonin c245fa45e3 Split K2 and K1 test data for multiplatform feature diagnostic
and add an explicit expect to the test data

^KT-31281
2023-07-12 10:50:33 +00:00
Anastasia.Nekrasova fcba0ad75e [Test] Add a test covering for resolution to subsumed members for raw types
^KT-57620
2023-07-12 09:11:01 +00:00
Timofey Solonin e12e78d96b Add an explicit diagnostic for when expect/actual modifiers are used in
an unsupported compilation

^KT-31281
2023-07-12 08:29:28 +00:00
Artem Kobzar fdda394a77 [K/JS] Calculate generated function names based on signatures of argument types (instead of fqNames) ^KT-49077 Fixed 2023-07-11 13:14:45 +00:00
Denis.Zharkov e94a0b8483 K2: Suppress "unused" for some methods at DependencyListForCliModule
Because we assume this part as a part of a public API
2023-07-11 13:12:22 +00:00
Denis.Zharkov e98890cece K2: Remove a bunch of unused declarations 2023-07-11 13:12:22 +00:00
Denis.Zharkov 1705d5f704 K2: Add @Supress("unused") to debug-related helpers 2023-07-11 13:12:22 +00:00
Denis.Zharkov f7e54fa76a K2: Simplify FirToConstantValueTransformer hierarchy
FirToConstantValueTransformerSafe was unused and then
there only one FirToConstantValueTransformer left
2023-07-11 13:12:22 +00:00
Denis.Zharkov 379ec2fae8 K2: Get rid of redundant enum at FirOptInUsageBaseChecker 2023-07-11 13:12:22 +00:00
Denis.Zharkov 987fa87c90 K2: Remove redundant parameters in ClassWrapper 2023-07-11 13:12:22 +00:00
Denis.Zharkov 03e06be324 K2: Remove redundant TypeModifier class 2023-07-11 13:12:22 +00:00
Dmitriy Dolovov b7bd078a31 [PL] Lower the default PL engine messages log level down to INFO
^KT-59136
2023-07-11 11:37:35 +00:00
Jinseong Jeon 6fc02c3408 SLC: ROOT package exists no matter what
^KT-59843 Fixed
2023-07-11 11:47:23 +02:00
Ivan Kylchik 076305bb78 [Test] Drop SMAPTestUtil.kt file
It is not used anywhere. Probably left after transition to new test
infrastructure.
2023-07-11 09:30:26 +00:00