Commit Graph

100807 Commits

Author SHA1 Message Date
Jinseong Jeon 501ec4fdbf AA: fix typo in KtLibrarySourceModule description 2023-05-01 16:26:54 +02:00
Sebastian Sellmair e547ea29b3 [Gradle] Raise min required AGP version for Multiplatform to 7.0
^KT-58281 Verification Pending
2023-05-01 13:07:37 +00:00
Sebastian Sellmair f2270ccdc7 [Gradle] Enable Multiplatform/Android SourceSetLayout v2 by default
^KT-58281 Verification Pending
2023-05-01 13:07:37 +00:00
Sebastian Sellmair 56ba5a284d [Gradle] Add unit test, checking which metadata compilations are created
This will quickly notify any developer if some code
has unexpected effects on the creation of metadata compilations

^KT-58319 Verification Pending
2023-05-01 13:05:47 +00:00
Sebastian Sellmair 8273328726 [Gradle] ProjectMetadataProvider: Allow nullable compiled metadata for SourceSet
The commit leading to the issue described in KT-58319 was:
510eca9da1
[Gradle] Implement source set inspection methods as 'suspend'

In this commit one method called
'getCommonSourceSetsForMetadataCompilation' was implemented
in a suspend style.

This re-implementation however introduced a semantic change to the function:
Previously this method (counterintuitively) returned commonMain
even if the SourceSet only participated in a single platform compilation.
This is because the KotlinMetadataTarget still cas a 'main' compilation
that includes 'commonMain'. The previous implementation did not filter
this compilation therefore found two platform types for the SourceSet,
assuming that it can be compiled to metadata.

This lead to a 'commonMain' compilation created which then gets
correctly disabled by 'isMetadataCompilationSupported'.

After the commit, a single target project did not create a 'commonMain'
compilation anymore. This leads to no metadata being provided
by the metadata provider. This seems OK, but the 'ProjectMetadataProviderImpl'
threw an error in cases the IDE requested this metadata.

^KT-58319 Verification Pending
2023-05-01 13:05:47 +00:00
Sebastian Sellmair 900f26f3c5 [Gradle] Implement KT58319ProjectMetadataProviderTest to cover KT-58319 2023-05-01 13:05:47 +00:00
Pavel Kunyavskiy f55fd481e9 [K/N] Refactor default argument lowering to avoid boxing
Current inline classes API is not compatible between different backends.
So implementing common function required for this optimization
was not possible in Native backend.

So, common default arguments lowering was refactored to make bigger
piece of code replaceable in backends.

^KT-57860
2023-05-01 13:04:21 +00:00
Alexander Korepanov 2aea5822b2 [JS IR] Unmute all fir invalidation tests 2023-05-01 12:56:12 +00:00
Alexander Korepanov 9da9c95105 [JS IR] Add IC test for interface with default implementation 2023-05-01 12:49:07 +00:00
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