Commit Graph

7458 Commits

Author SHA1 Message Date
Stanislav Ruban 1f3d318cae [tests][FIR][checkers][JS] Add test data for KT-66673 2024-03-18 15:57:59 +00:00
Vladimir Sukharev 0ae7c66fc8 [Tests] Drop DCE tests
^KT-44602
2024-03-16 07:50:33 +00:00
Vladimir Sukharev e03af07a1c [Tests] Revive KlibEvolutionTests
Allows CI testing for KT-44602, KT-44604, KT-44598, KT-44599, KT-66342

^KT-44602
2024-03-16 07:50:33 +00:00
Artem Kobzar eb8054ac1e [K/Wasm] Fix object optimization false trigger on non-pure objects ^KT-66471 Fixed 2024-03-14 17:12:45 +00:00
Artem Kobzar 75eeb5291d [K/JS] Add test for the private inner class bug ^KT-65657 2024-03-14 12:48:24 +00:00
Dmitriy Dolovov d43db973d4 API 4 ABI: Rename manifest property: wasm_target -> wasm_targets
^KT-66367
2024-03-14 10:33:00 +00:00
Dmitriy Dolovov cec36355b2 [JS] Don't turn on PL in tests with IGNORE_ERRORS directive
^KT-64817
2024-03-14 07:53:48 +00:00
Mads Ager b0bc017a16 [Parcelize] Add test for parcelize in multiplatform setting.
This tests that classes in common code can have code generated
for them in android compilations.
2024-03-14 06:52:19 +00:00
Vladimir Sukharev 5fee662223 [Tests] Add test for KT-57391
^KT-57391
2024-03-12 18:10:10 +00:00
Igor Yakovlev 7c16528560 [Wasm] PL tests implementation for Wasm target
Fixed #KT-58088
2024-03-12 14:36:45 +00:00
Ivan Kylchik e1180adfbd [Native] Always cast expression to the expected type after inline
Right now, during the process of inlining, the compiler erases types.
Because of that, we can end up with some random type
(for example, `Any`) where the concrete type was
expected (for example, `Int`). Compiler must insert a cast in the
required places.

#KT-66017 Fixed
2024-03-12 08:19:50 +00:00
Dmitriy Novozhilov 7a383373b0 [Test] Reproduce KT-65415 and KT-66432 2024-03-12 06:46:09 +00:00
Dmitriy Novozhilov d352cc9d96 [Frontend] Make DiagnosticSuppressor a project-level extension
Originally it was an application-level component, which caused non-trivial
  logic and cognitive load to carefully handle those extensions to avoid
  memory leaks.

6740a596 introduced a way to easily register `DiagnosticSuppressor` to
  project, and this commit continues this work, making it a proper
  project-level extension

A lot of changes caused by the fact, that this extension is needed to be
  obtained from `BindingContext` (see `BindingContextSuppressCache` and
  its usages), so almost all changes are introducing `Project` to
  `BindingContext`

^KT-66449 Fixed
2024-03-12 06:43:58 +00:00
Igor Yakovlev 6930fc8fed [WasmJs] Add support for external class reflection
Fix #KT-64890
2024-03-09 10:40:46 +01:00
Dmitriy Novozhilov 4b5eac7816 [Test] Add regression tests for issues which are fixed in K2
Related issues:
KT-10879, KT-18055, KT-20617, KT-23873
KT-25668, KT-31191, KT-33108, KT-41013
KT-51827, KT-53886, KT-56624, KT-58447
KT-58458, KT-58751, KT-58814, KT-60597
KT-62806, KT-63258, KT-63444, KT-65101
KT-65408, KT-65844, KT-66186

^KT-65926 Fixed
2024-03-07 12:49:47 +00:00
Dmitriy Novozhilov b875ae774e [FIR] Unwrap captured types in target type of SAM conversion
^KT-66256 Fixed
2024-03-07 12:41:05 +00:00
Vladimir Sukharev a9af52c288 [Tests] Add test for KT-44199
^KT-44199 Fixed
2024-03-07 11:36:49 +00:00
Vladimir Sukharev b4bc576d37 [Tests] Add test for kt33411
^KT-33411 Fixed


Merge-request: KT-MR-14782
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2024-03-07 08:46:05 +00:00
Ilmir Usmanov 0bb6359ac5 Minor. Add regression tests
#KT-64725 Fixed
 #KT-64726 Fixed
 #KT-64727 Fixed
2024-03-06 18:16:59 +00:00
Denis.Zharkov b7129f78a3 K2: Fix IAE at Candidate.updateSourcesOfReceivers inside PCLA lambda
Previously, it was failing at line
(resolvedReceiver?.toReference(session) as? FirNamedReferenceWithCandidate)?.candidate?.updateSourcesOfReceivers()

But this line was mostly incorrect because in case of `a.b()` call,
which is resolved to `a.b.invoke()`, `resolvedReceiver` is pointing to
`a` instead of obviously expected `a.b`.

The fix with using `candidate.callInfo.explicitReceiver` doesn't help
either because the candidate of that receiver is always completed at
that stage (so no Candidate there).

The only case when the candidate was still there is PCLA because
 in that case we explicitly don't fully complete even receiver
expressions.
(see docs/fir/pcla.md)

The idea of the fix is moving the call of `updateSourcesOfReceivers`
for invoke property receiver to the place just before the candidate
is being converted to the resolved reference
(i.e., the candidate is being lost)

^KT-66148 Fixed
2024-03-06 17:01:57 +00:00
Artem Kobzar 77f0cba23f [K/JS] Introduce v2015 target 2024-03-06 12:21:38 +00:00
Ilya Goncharov b157a8eae5 [Wasm] Add wasm target to Klib manifest
^KT-66327 fixed
2024-03-06 10:57:50 +00:00
Mikhail Glukhikh 5ea6f20192 K1/K2: add reproducers for KT-66229, KT-66243 and KT-66272
As all these issues aren't reproducible in K2, we may count them as fixed.
Related to KT-53478
#KT-66229 Fixed
#KT-66243 Fixed
#KT-66272 Fixed
2024-03-06 09:01:38 +00:00
Kirill Rakhman 4c93e9cff6 [FIR] Fix captured type arguments of local class as callable reference LHS
#KT-66267
2024-03-06 08:22:42 +00:00
Kirill Rakhman 69a7bf7f68 [FIR] Add equality constraint from expected type for some synthetic function calls
This fixes some cases where we infer some type variable inside one
of the branches to Nothing instead of the expected type because Nothing
appeared in some other branch.

Specifically, we add an equality instead of a subtype constraint during
completion of calls to synthetic functions for if/when, try and !!.
We don't do it when the call contains a (possibly nested) elvis or is
inside the RHS of an assignment.
Otherwise, we would prevent some smart-casts.

#KT-65882 Fixed
2024-03-05 17:38:59 +00:00
Artem Kobzar 8d4948c3ee [K/Wasm] Generate .d.ts tests for K/Wasm in the same way as we do for K/JS ^KT-65778 Fixed 2024-03-05 15:33:56 +00:00
anzhela.sukhanova 82255d5ee8 [Test] KT-61360: add tests for the IrFakeOverrideBuilder
Add tests for fake overrides with focus on java interoperability

Co-authored-by: Aleksandra Arsenteva <aleksandra.arsenteva@jetbrains.com>
2024-03-04 16:21:02 +00:00
Artem Kobzar 4b57f38e4e [K/JS] Regenerate tests after merging two different changes into TS generator 2024-03-04 14:40:40 +00:00
Pavel Kunyavskiy 8d725753f8 [Fir2IR] Don't build overrides for expect classes.
We don't need them except for checking.
And checking doesn't work in any reasonable way anyway.

^KT-65249 Fixed
2024-03-04 14:12:48 +00:00
Artem Kobzar 35acade031 [K/JS] Fix problem with saving of parameter's default values after overriding ^KT-63907 Fixed 2024-03-01 13:20:33 +00:00
Pavel Kunyavskiy 807d352ed4 [Tests] Add test for already fixed KT-60847
^KT-60847 Fixed
2024-03-01 12:51:21 +00:00
Artem Kobzar ee2aa6d67f [K/JS] Fix interfaces inside TypeScript definitions if they have only an external interface parent ^KT-64708 Fixed
Merge-request: KT-MR-14665
Merged-by: Artem Kobzar <Artem.Kobzar@jetbrains.com>
2024-03-01 09:37:00 +00:00
Artem Kobzar 1c2570ed7e [K/JS] Fix Companion object overriding problem inside TypeScript Definitions ^JBAI-680 Fixed 2024-02-29 17:48:24 +00:00
Dmitriy Dolovov b3efc05728 [Test] Rename JsBackendDiagnosticsHandler -> KlibBackendDiagnosticsHandler
^KT-64393
2024-02-29 16:44:45 +00:00
Dmitriy Dolovov a4f2a4438b [Test] Move JsBackendDiagnosticsHandler to common test infra
^KT-64393
2024-02-29 16:44:45 +00:00
Artem Kobzar 4f4c98ec73 [K/JS] Allow parameter properties inside external declarations ^KT-65965 Fixed 2024-02-29 09:46:59 +00:00
Artem Kobzar 6a2e785abd [K/JS, TEST] Enable TS export tests for FIR ^KT-64421 Fixed 2024-02-28 16:52:27 +00:00
Igor Yakovlev a5ef668e3c [Wasm] Boolean boxed instances are the same
Fixed #KT-65411
2024-02-28 15:23:21 +00:00
Dmitriy Novozhilov 5c632bc78e [FIR2IR] Don't create f/o symbols on smartcasted Nothing in dispatch receiver
^KT-63525 Fixed
2024-02-28 08:28:14 +00:00
Marco Pennekamp 708ed81eb2 [Test] Avoid importing unused @Nested annotations in generated tests
- Unused `Nested` imports frequently cause unused import warnings in the
  IDE, which are especially annoying in after-commit warning/error
  analysis.
2024-02-27 20:30:06 +00:00
Artem Kobzar 800704a130 [K/JS] Allow private constructors inside external declarations ^KT-65964 Fixed 2024-02-27 16:51:07 +00:00
Artem Kobzar 3429cbd321 [K/JS] Support companion objects in external and exported declarations 2024-02-27 16:30:13 +00:00
Dmitriy Dolovov f204293e4d [Test] Unify work with KLIB artifact paths and dependencies
Unify functions from `JsEnvironmentConfigurator` and
`WasmEnvironmentConfigurator` that do the same logic. Make this logic
also be available for `NativeEnvironmentConfigurator`:
- get*ArtifactSimpleName()
- get*KlibArtifactPath()
- get*KlibOutputDir()
- getAllRecursiveLibrariesFor()
- getAllRecursiveDependenciesFor()
- getAllDependenciesMappingFor()
- getKlibDependencies()

This would allow to have the same logic in one place, and also
reuse it in `IrBackendFacade`s to be implemented for Native.

^KT-65117
2024-02-27 15:22:47 +00:00
Andrei Tyrin 4e10dcd808 [tests] Klib based signature clash improve coverage for KT-63670 2024-02-27 14:01:44 +00:00
Mikhail Glukhikh 678816f9e8 K1: introduce BUILDER_INFERENCE_STUB_PARAMETER_TYPE to prevent compiler crashes
This diagnostic is reported in rare situations when
StubTypeForBuilderInference is kept as a parameter type
of for loop or lambda. Before this commit, we had in K1
"Could not load module <error module>" from IrLinker instead.

Related to: KT-52757, KT-53109, KT-63841, KT-64066
#KT-53478 Fixed
2024-02-27 10:25:13 +00:00
Vladimir Sukharev febac0dd5f [Tests] Migrate backend-independent tests from native to compiler/testData.
^KT-65979
2024-02-26 13:38:49 +00:00
Dmitriy Novozhilov 9857bdc891 [FIR2IR] Unwrap typealiases during applying of suspend conversion
^KT-65002 Fixed
2024-02-26 08:56:24 +00:00
Nikita Nazarov 407448d8e3 [JVM] Implement new inlined variable naming format
^KT-65478 fixed
2024-02-23 23:59:13 +01:00
Pavel Kunyavskiy c991535756 [IRFakeOverrides] Fix accessors visibilities
^KT-65801
2024-02-23 16:35:27 +00:00
Artem Kobzar be47632609 [K/JS] Optimize logical operators generating 2024-02-23 15:16:31 +00:00