Commit Graph

100798 Commits

Author SHA1 Message Date
Mikhail Glukhikh 180613e1c6 K2: calculate deprecations for backing field properly
#KT-58224 Fixed
2023-05-01 11:59:20 +00:00
Mikhail Glukhikh 94c94d0605 K1: add a language feature to negate new errors from DiagnosticReporterByTrackingStrategy
Related to KT-55055, KT-55056, KT-55079, KT-57854
2023-05-01 11:47:01 +00:00
Mikhail Glukhikh 4188bca9b8 K1: don't report RECEIVER_TYPE_MISMATCH with -ProperTypeInferenceConstraintProcessing
Related to KT-55056
#KT-57854 Fixed
2023-05-01 11:47:01 +00:00
Mikhail Glukhikh 04812332f9 FE: add tests reproducing KT-57854 2023-05-01 11:47:01 +00:00
Ilya Goncharov a3d45964f3 [Gradle, JS] Add test with webpack + es modules 2023-05-01 10:45:02 +00:00
Ilya Goncharov 5b47b1ac24 [Gradle, JS] esmodules for webpack 2023-05-01 10:45:01 +00:00
Ilya Goncharov 6654cc6209 [Gradle, JS] Fix dom-api-compat friendPaths 2023-05-01 10:38:57 +00:00
Dmitriy Novozhilov 172501b9e0 Advance bootstrap to 1.9.20-dev-154 2023-04-30 17:43:20 +00:00
Dmitriy Novozhilov cc6c378b68 [FIR] Don't perform suspend conversion for anonymous functions
^KT-58329 Fixed
2023-04-30 16:12:54 +00:00
Dmitriy Novozhilov f6f85eeb88 [FIR] Cleanup FirHelpers.kt 2023-04-30 16:12:54 +00:00
Dmitriy Novozhilov 82653855ab [FIR] Report missing ASSIGNMENT_TYPE_MISMATCH on functional types
^KT-45989
2023-04-30 16:12:54 +00:00
Dmitriy Novozhilov 71d6103122 [FIR] Report ASSIGNMENT_TYPE_MISMATCH on properties with numeric types
^KT-46047
^KT-56951 Fixed
2023-04-30 16:12:54 +00:00
Dmitriy Novozhilov f7733e819d [FIR] Approximate captured types during approximation of local types
^KT-57222 Fixed
2023-04-30 15:58:32 +00:00
Dmitriy Novozhilov ad002437b4 [Test] Add test for KT-57968 2023-04-30 15:58:31 +00:00
Vladimir Dolzhenko adc5fe6e4e rr/vd/KT-57514
Revert "Create SimpleFunctionDescriptorImpl under nonCancelableSection"

This reverts commit d959b3a289b24487dba2e36da94a34a0dbb4661e.

Revert "Create PropertyDescriptorImpl under nonCancelableSection"

This reverts commit 362e8c2151c8e18009463fd51b995cce27ac8eb5.

Merge-request: KT-MR-9772
Merged-by: Vladimir Dolzhenko <Vladimir.Dolzhenko@jetbrains.com>
2023-04-29 06:39:59 +00:00
Vyacheslav Karpukhin ec3e13a091 Drop AndroidDependencyResolver, since it's not used anymore 2023-04-29 01:42:15 +02:00
Alexander Udalov 4f66d5bb1c JVM: minor, change logic of anyAnnotationDisablesIndyLambdaGeneration.kt
Do not check that non-indy-generated lambdas inherit from Lambda,
because when we enable indy lambdas by default, we're also changing the
behavior of non-indy lambdas so that they won't have the Lambda
superclass anymore (see KT-45375). Since this test was added to check
that any annotation disables indy lambda generation, just leave those
lambdas and rely on the CHECK_BYTECODE_TEXT directive to verify that
there are no LambdaMetafactory in the bytecode text.
2023-04-28 21:34:19 +00:00
Alexander Udalov 4d7506bae3 JVM: enable indy lambdas in some tests explicitly
To simplify enabling of indy lambdas by default.
2023-04-28 21:34:19 +00:00
Alexander Udalov cd9209a7ee JVM: enable -Xlambdas=class in some codegen tests
Most of these tests check the specific structure of lambdas when they
are generated as classes, and they start to fail once invokedynamic
lambdas are enabled by default.
2023-04-28 21:34:19 +00:00
Alexander Udalov 163afc94bc JVM: prepare asmLike tests for indy lambdas by default
Use -Xlambdas=class in tests which were checking specific things related
to how anonymous classes for lambdas work (such as receiver mangling,
function arity etc.)
2023-04-28 21:34:19 +00:00
Vladimir Sukharev 4c4afbd646 [K2/N] Don't emit and check lazy headers for ObjCExport tests. Enable these tests.
Merge-request: KT-MR-9861
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-04-28 19:02:47 +00:00
Dmitrii Krasnov 36fc398358 migrated XCFrameworkIT and AppleSiliconIT to junit5 and gradle TestKit 2023-04-28 18:24:29 +00:00
Dmitrii Gridin 2cac7319fe [LL FIR] add test on lazy resolve for local declarations
^KT-56550
2023-04-28 18:08:01 +00:00
Ilya Gorbunov b35b727d73 KT-53778 Remove experimental annotations from open ranges 2023-04-28 17:12:15 +00:00
Ilya Gorbunov 9953991c4c Include WasExperimental into builtins serialization
It is required for stabilizing previously experimental
builtin functions and classes (KT-53778)
in order to mark them WasExperimental,
so that they are available for previously opted in users
2023-04-28 17:12:15 +00:00
Alexander Shabalin 968bf424b4 [K/N] Fix interop_objc_kt56402 with different GCs ^KT-56402
Merge-request: KT-MR-9865
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2023-04-28 17:10:07 +00:00
Ilya Goncharov dee3bbb4bf [Gradle, JS] Fix testing of composite build without respect of work of NPM, just look on generated package.json 2023-04-28 16:40:11 +00:00
Denis.Zharkov 555d8eeb25 K2: Fix false-positive DELEGATE_SPECIAL_FUNCTION_NONE_APPLICABLE
For explanation, see nestedPartiallyResolvedCallsSimple.k

The problem was caused by "select" variable is being leaked to the
inference session of delegate while it should not happen because
it doesn't belong to the common system of `KotlinVal { ..` call,
as we complete it with fixing `E` variable during completion
for `A(select(null, fun(): Int { return 1 }))`.

The root of the problem is that we were adding all the partial
nested calls to the session, while in fact we only need there
the top-level one.

^KT-57543 Fixed
2023-04-28 16:20:06 +02:00
Denis.Zharkov 8b81c3715d Minor. Cleanup FirDelegatedPropertyInferenceSession a bit
- Some functions might be private
- the stubTypeBySyntheticTypeVariable map is actually write-only
- integrateConstraints Boolean return value is always unused
2023-04-28 16:20:06 +02:00
Dmitrii Gridin f425dea3b8 [CLI] JvmDependenciesIndexImpl: add lock to make it thread safe
Can be rewritten to multi-thread implementation in the feature

^KT-56550
2023-04-28 13:41:05 +00:00
Dmitriy Novozhilov 15dfe6c750 [FIR2IR] Use signature instead of FIR as a key for fake-override storage
This is needed to correctly handle the case, when we have the same java
  class in common and platform module. In this scenario we have two
  different classes on frontend (because symbol providers are not shared)
  and completely different enhanced function in scopes of those classes,
  but exactly one IrClass for those classes, which is cached during
  conversion of common module together with cache of its fake overrides.
  So using FirDeclaration as a key to FO cache leads to the problem, when
  we can not find cached value for platform module, because it has different
  fir declarations for the same real decalration

^KT-58030 Fixed
2023-04-28 13:08:19 +00:00
Denis.Zharkov 7b46c59d57 K2: Complete property-candidate before starting invoke resolution
Before this commit, for property candidates in K2 their types wasn't
inferred/susbtituted properly.

So, when candidate for fooBar.liveLoaded.invoke() was created,
the type of `fooBar.liveLoaded` was just X type parameter for which
there is no any `bar()` functions in its member scope.

While proposed semantics is a bit different from K1, where
both property and invoke candidates are united into common system,
it doesn't contradict to the specification (https://kotlinlang.org/spec/overload-resolution.html#callables-and-invoke-convention)
which says explicitly that invoke-convention should be desugared as
`r.foo.invoke()`, thus `r.foo` should be completed independently.

Also, this strategy supports some reasonable use-cases like KT-58259
while it's still a breaking change but for more artificial-looking
situations (see KT-58260) and should be passed through
the language committee.

The changes in stubTypeReceiverRestriction* tests looks consistent
because of how `genericLambda` now works
(with full completion of property call).
NB: The code is going to be red once KT-54667 is fixed and also there's
already similar diagnostic in K1 (INFERRED_INTO_DECLARED_UPPER_BOUNDS)

^KT-58142 Fixed
^KT-58259 Fixed
^KT-58260 Related
2023-04-28 12:46:20 +00:00
Dmitrii Gridin 481becb342 [LL FIR] implement LLFirReturnTypeCalculatorWithJump
To provide the correct designation and locks strategy

^KT-56550
^KT-58083 Fixed
2023-04-28 11:59:02 +00:00
Marco Pennekamp f903cb6bbc [JVM IR] KTIJ-25152 Reference undiscovered expect symbols
- When the bytecode tool window opens a file containing `actual`
  declarations, not all the `expect` symbols reachable via the `actual`
  symbols' descriptors might be contained in the symbol table, because
  the source of the `expect` members is not included in the files to
  compile. This caused an issue during lowering in
  `ExpectDeclarationRemover.tryCopyDefaultArguments`.
- The solution adds `expect` symbols reachable via `actual` declarations
  to the symbol table, so that these `expect` symbols can subsequently
  be stubbed.

^KTIJ-25152 fixed
2023-04-28 11:36:18 +00:00
Alexander Udalov fc0ce415d7 JVM: remove source code from not null assertion message text
This is implemented under a LanguageFeature which will be enabled later,
when behavior change described in KT-57570 is approved.

 #KT-57570
2023-04-28 10:26:15 +00:00
Nataliya.Valtman ea264cb5b5 Add kotlin-build-statistics embedded dependency for JPS
#KT-58314: Fixed
2023-04-28 09:22:00 +00:00
Nikolay Krasko 3caa1d1349 Refactoring: fix usages of @TestOnly ExtensionsArea.registerExtensionPoint 2023-04-28 08:25:19 +00:00
Nikolay Krasko 6e18b75c73 [213] Do not remove deprecated ExtensionsArea.registerExtensionPoint
The method is proved to be used in klint project
https://github.com/pinterest/ktlint/blob/c5a81e0d4198fa5cb2cac69967080e01e365b837/ktlint-rule-engine/src/main/kotlin/com/pinterest/ktlint/rule/engine/internal/KotlinPsiFileFactory.kt#L121

There is an issue about the remove: https://github.com/pinterest/ktlint/issues/1981

KTI-1114
2023-04-28 08:25:19 +00:00
Alexander Shabalin cd93100148 [K/N] Fix sleeping in RWSpinLockTest ^KT-56233 2023-04-27 16:49:30 +00:00
Alexander Shabalin e6c0f32477 [K/N] Fixing ConcurrentMarkAndSweepTest ^KT-56233 2023-04-27 16:49:30 +00:00
Sebastian Sellmair 4e74f7e57c Enable new mpp dependency resolution
KT-58319
2023-04-27 18:38:45 +02:00
Yahor Berdnikau 982a4fbda0 Print in the console report showing amount of tasks used K2
^KT-57736 Fixed
2023-04-27 14:32:47 +00:00
Dmitrii Krasnov 847544d99c Removed jfrog repository from kapt integration tests
#KT-58022
2023-04-27 14:19:22 +00:00
Gleb Lukianets 242ca73d83 rrn/rd/KT-55578 User-provided hints for linker errors
[K/N] KT-55578 Show customized user suggestions on linkage errors

Merge-request: KT-MR-9636
Merged-by: Gleb Lukianets <Gleb.Lukianets@jetbrains.com>
2023-04-27 14:14:43 +00:00
Andrei Klunnyi 1e0115aef8 KT-57468 Kotlin assignment plugin: operation name cannot be found
The problem results in broken import quick fix and import optimizer on
the IDE side [1].

`AssignResolutionAltererExtension` introduced a possibility to override
 resolution of assignment statements. The inconsistency though is
 that `KtSimpleNameReference.getResolvesByNames` doesn't return a name
 for the overridden `=`. Kotlin as a language doesn't support this [2].

This commit eliminates the drawback above:
1. It fixes the name `assign` the `=` can be resolved to [3].
   This eliminates the need to search for the name, bypassing the
   plugins.
2. `KtSimpleNameReference.getResolvesByNames` returns `assign` among
   other names in case it deals with binary `=` and assignment is
   resolved.
3. `KtCompilerPluginsProvider` was extended to check plugins' presence.
   K1 implementation added.

----------------------------------------------------------------
[1]: https://youtrack.jetbrains.com/issue/KTIJ-24390
[2]: OperatorConventions.getNameForOperationSymbol
     https://kotlinlang.org/docs/operator-overloading.html#augmented-assignments
[3]: OperatorConventions#ASSIGN_METHOD + AssignmentPluginNames
2023-04-27 14:05:02 +00:00
Andrei Klunnyi 4c1a66b7d6 KT-57468 Kotlin assignment plugin: publish K2 & CLI artefacts
This commit effectively proceeds with the fix [1] but now in the context
of [2]. It includes jars from the assignment compiler plugin.

----------------------------------------------------------------------
[1]: https://youtrack.jetbrains.com/issue/KTIJ-24438
[2]: https://youtrack.jetbrains.com/issue/KTIJ-24390
2023-04-27 14:05:02 +00:00
Kirill Rakhman bd9f36ad01 [FIR] Move type parameter scope above member and static scopes in tower
This fixes a false positive TYPE_PARAMETER_IS_NOT_AN_EXPRESSION when
a type parameter and some member, static or companion declaration have
the same name and referred to inside a class.

#KT-58028 Fixed
2023-04-27 13:59:13 +00:00
Dmitriy Novozhilov 7958a9debd [FIR2IR] Correctly generate delegating constructor call for secondary constructors in enums
^KT-56927 Fxied
2023-04-27 13:35:14 +00:00
Kirill Rakhman a818c543a9 [FIR] Verify diagnostic messages don't reference non-existent parameters 2023-04-27 12:54:31 +00:00
aleksandrina-streltsova c956b4aeae [Analysis API FIR] Use stable module name when mangling internal name
^KTIJ-25046
2023-04-27 12:36:20 +00:00