Commit Graph

127 Commits

Author SHA1 Message Date
Vladimir Sukharev febac0dd5f [Tests] Migrate backend-independent tests from native to compiler/testData.
^KT-65979
2024-02-26 13:38:49 +00:00
Pavel Kunyavskiy e6fd523431 [IrFakeOverrideBuilder] Consolidate visibility handling
Now fake overrides declarations invisible for override
are totally ignored by FakeOverrideBuilder, instead of
creating fake overrides for them, and than filtering them
out later.

As side-effect it fixes KT-64972.

^KT-64974
2024-01-16 13:35:16 +00:00
vladislav.grechko 34bac48541 Add JVM ABI K1/K2 consistency tests 2023-12-26 10:18:19 +00:00
Artem Kobzar 55d41db2ce [K/JS] Include jsFirEs6Test into jsFirCompilerTest tests 2023-11-24 22:09:43 +00:00
Dmitriy Novozhilov c25cde8871 [FIR2IR] Provide correct module data to FirModuleDescriptor
Properly implement friend modules visibility check

^KT-61384 Fixed
^KT-62475 Fixed
2023-10-12 06:47:02 +00:00
Alexander Udalov 9f9287fb2e IR: keep flexible type annotations when building fake overrides
#KT-61751 Fixed
2023-09-15 09:40:45 +00:00
Alexander Udalov 21d56d04d6 Tests: reclassify some failures in fake override rebuilder tests
See issues for more information: KT-61751, KT-61804, KT-61805, KT-61370.
2023-09-13 15:01:52 +02:00
Pavel Kunyavskiy 91e96e9f31 [Fir2Ir] Introduce testing with IrFakeOverrideBuilder
^KT-61514
2023-08-31 13:12:15 +00:00
Nikolay Lunyak 13a7bb95b3 [FIR] Relax MULTIPLE_DEFAULTS_* to account for the K1 behavior
^KT-56442
^KT-36188
2023-08-28 10:57:40 +00:00
Nikolay Lunyak 3f1bf6112f [FIR] Report MULTIPLE_DEFAULTS_INHERITED_FROM_SUPERTYPES
Reporting it for `VIRTUAL_MEMBER_HIDDEN`
is ok, because `VIRTUAL_MEMBER_HIDDEN`
has always been an error, so we are
allowed to treat these as overrides
implicitly.

^KT-59408 Fixed
^KT-59419 Fixed
^KT-57076 Fixed
2023-08-28 10:57:40 +00:00
Nikolay Lunyak dc9ed5656e [FIR] Revert FirMultipleDefaultsInheritedFromSupertypesChecker
It's possible to write a fix that
would prevent false positives with
this checker, but the core
intuition behind it is invalid.

This checker assumes that it's
enough to only check direct
overriddens, while in reality
even simple `Source` override
functions are not allowed to
contain default values, so they
can't be used to make judgements
about them.

^KT-59408 Open
^KT-59408 Open

^KT-61095 Fixed
^KT-61165 Fixed
^KT-61029 Fixed
2023-08-17 13:55:19 +00:00
Alexander Korepanov 7a31167e0b [Common IR] Do not add internal methods to overrides
[JS IR] Use a module name in JsFunctionSignature for internal methods

^KT-60635 Fixed
2023-08-09 16:35:59 +00:00
Nikolay Lunyak 61448531cb [FIR] Support MULTIPLE_DEFAULTS_INHERITED_FROM_SUPERTYPES
^KT-59408 Fixed
2023-08-04 11:20:39 +00:00
Svyatoslav Kuzmich a3e2d2804c [Wasm] Update testData after adding K2 and new test infra support.
- Actualize muted K2 tests
- Actualize muted K1 tests with module systems because legacy Wasm test
  infra had no respect for "// MODULE: ..." test directives
2023-06-25 10:20:40 +02:00
Vladimir Sukharev 3d60ed8874 [Test] Convert IGNORE: NATIVE directives in box tests from A to C
^KT-59057

Merge-request: KT-MR-10747
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-06-22 08:39:20 +00:00
Nikolay Lunyak bcfafc601e Add EnumEntries to minimal-stdlib-for-tests
This change allows to revert adding `WITH_STDLIB` directive
to tests which happened at `a9343aeb`.

Co-authored-by: Alexander Udalov <Alexander.Udalov@jetbrains.com>
2023-03-02 10:23:38 +00:00
Nikolay Lunyak a9343aeb7d [FIR] KT-55840: Ensure everything actually works
This inconsistency is present due to not using the `// WITH_STDLIB`
in the above tests. When K1 creates the enum, it tries to generate
`entries()`, and for that it tries to load `kotlin.enums.EnumEntries`,
but this is actually an unresolved reference. K1 silently swallows it,
and proceeds.

The reason K2 doesn't fail is that in order to generate `entries()` it
simply creates the necessary `ConeClassLikeType` with the desired
`classId` instead of loading the whole `ClassDescriptor`.

The reason we can still observe `$ENTRIES` and `$entries` in K1
is because they are generated during the JVM codegen, and it
only checks if the `EnumEntries` language feature is supported. It
doesn't check if the `entries` property has really existed in IR
(by this time it's expected to have already been lowered to the
`get-entries` function - that's why "has ... existed").

The reason why the codegen doesn't fail when working with
`kotlin.enums.EnumEntries` is because it creates its
own `IrClassSymbol`.

^KT-55840 Fixed

Merge-request: KT-MR-8727
Merged-by: Nikolay Lunyak <Nikolay.Lunyak@jetbrains.com>
2023-02-10 16:57:51 +00:00
Artem Kobzar 71486a321c [K/JS] Add support of compilation with ES-classes 2023-01-17 18:14:17 +00:00
Vladimir Sukharev 924898afb7 [K/N] KFC-446: K2 platform: Native alpha
Merge-request: KT-MR-7905
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-01-04 16:10:40 +00:00
Ilya Chernikov 78ca733c38 FIR JS: add K2 variants of all other JS tests
except tests that are not possible to add without some modifications in
the test infra. See todos on the commented-out test declarations
2022-11-12 16:28:24 +01:00
Ilya Chernikov 5b3816cce5 Test infra: refactor IGNORE_BACKEND directive
treat it as a general one, introduce *_K1 and *_K2 variants for
more specific ignoring
2022-11-12 16:28:23 +01:00
Ilya Goncharov 372a512c91 [JS IR] Add case with bridge for method with default parameters 2022-10-31 16:08:24 +00:00
Ilya Goncharov fd5fba6f09 [JS IR] Fix case with bridge with nested classes
^KT-54686 fixed
2022-10-26 12:56:03 +00:00
Igor Yakovlev 38dd68f1f4 [WASM] Enable passing tests 2022-09-15 16:27:46 +00:00
Sergej Jaskiewicz 4a724611d8 [JS IR] Extract varargs in bridges generated for external methods
The issue this commit fixes occurs when we have an external interface
implemented by a Kotlin class, if that interface has methods with
varargs.

Kotlin functions expect varargs passed as arrays, but JavaScript code
may be unaware of this convention.

So, when generating a bridge for external interface method
implementaion, we insert some additional logic for extracting varargs
using the JavaScript `arguments` object.

A simplified example:

```kotlin
external interface Adder {
    fun sum(vararg numbers: Int): Int
}

class AdderImpl: Adder {
    override fun sum(vararg numbers: Int) = numbers.sum()
}
```

For `AdderImpl` we generate the following JS code:
```js
AdderImpl.prototype.sum_69wd7h_k$ = function (numbers) {
  return sum(numbers);
};
AdderImpl.prototype.sum = function () {
  var numbers = new Int32Array([].slice.call(arguments));
  return this.sum_69wd7h_k$(numbers);
};
```

#KT-15223 Fixed
2022-01-27 11:06:17 +00:00
Ilya Goncharov 6adcbe081e [JS IR] Consider erasing type parameters in return type in js signatures 2021-12-13 16:16:59 +00:00
Mikhail Glukhikh cf104c8433 FIR: add status line to all failing black box tests 2021-11-20 03:37:31 +03:00
Ivan Kylchik c7435ba760 Replace all occurrences of WITH_RUNTIME with WITH_STDLIB
We are going to deprecate `WITH_RUNTIME` directive. The main reason
behind this change is that `WITH_STDLIB` directive better describes
its meaning, specifically it will add kotlin stdlib to test's classpath.
2021-11-17 15:26:38 +03:00
Ilya Goncharov d6112224b4 [JS IR] Generate references from fake override to body in case of generic superclass 2021-11-11 15:12:34 +00:00
Svyatoslav Kuzmich aa5f98f919 [JS] Remove KJS_WITH_FULL_RUNTIME for tests that already have WITH_RUNTIME 2021-10-07 22:36:18 +03:00
Svyatoslav Kuzmich 6eb81517a0 [Wasm] Unmute passed Wasm tests 2021-10-02 06:14:35 +00:00
Svyatoslav Kuzmich c88cde2f8b [Wasm] DONT_TARGET_WASM_BACKEND => IGNORE_BACKEND in testdata 2021-10-02 06:14:35 +00:00
Svyatoslav Kuzmich ab9a23cbfa [Wasm][Stdlib] Reuse K/N collections and StringBuilder 2021-10-01 17:18:49 +03:00
Svyatoslav Kuzmich a2bfcfeae8 [Wasm] Do not erase interfaces down to Any type in Wasm signature.
This enables overloading virtual methods with different interface types
2021-09-22 19:49:44 +03:00
Steven Schäfer 1eb9a5a86d JVM IR: Don't generate bridges for default argument stubs (KT-46389) 2021-09-22 18:45:54 +02:00
Igor Laevsky 00f61978b8 WASM: Enable exception handling tests 2021-09-08 19:56:38 +03:00
Igor Laevsky c526145a48 WASM: Disable bunch of tests which expose the same issue after switch to the wasm native strings 2021-08-04 16:23:37 +03:00
Mikhael Bogdanov 70df4f10c5 Update test affected by AbstractClassMemberNotImplementedWithIntermediateAbstractClass feature 2021-07-16 13:26:34 +00:00
Mikhail Glukhikh 84ccf7bbb1 FIR: use Java 8 rules in not implemented checker 2021-04-30 17:59:38 +03:00
Mikhail Glukhikh 2bf3abcb29 FIR: cache accessor symbols in JavaClassUseSiteMemberScope 2021-02-26 12:27:07 +03:00
Dmitry Petrov ad8bed078f JVM box tests for KT-24193 2020-12-23 21:50:09 +03:00
Dmitry Petrov e59c8e0a5c JVM_IR KT-42137 bridges are not generated for fake overrides 2020-11-20 14:33:20 +03:00
Georgy Bronnikov 364773bf0f IR: fix IrClassSymbol.starProjectedType 2020-11-12 21:49:11 +03:00
Svyatoslav Kuzmich fdd7fa5aea [Wasm] Mute codegen box tests 2020-11-09 16:04:43 +03:00
Mikhail Glukhikh 2dc6467b5d [FIR] Modify signatures also from ERASED_COLLECTION_PARAMETER_SIGNATURES
In this commit we change value parameter type of containsAll, removeAll,
retainAll from Java collections. Originally it's Collection<?>,
we change it to Collection<T>

#KT-42340 Fixed
2020-10-28 18:09:11 +03:00
Denis Zharkov 3dfbd36f15 FIR: Unmute passing blackbox tests 2020-10-01 17:49:02 +03:00
Dmitry Petrov c03573fc18 JVM_IR fix override equivalence check for collection stub generation
KT-42043 KT-42033
2020-09-22 15:26:34 +03:00
Mikhail Glukhikh ec93e5886a [FIR2IR] Fix generation of accessors' extension receiver (f/o case) 2020-09-11 11:43:00 +03:00
Mikhail Glukhikh 3f5beb77e8 [FIR2IR] Cache delegatable members properly 2020-08-31 14:31:55 +03:00
Juan Chen d163853c97 [FIR] add support for implementation by delgation
This commit handles "subclass: super-interface by delegate-expression".

During Psi2Fir, for each delegate, we add to the subclass a synthetic
field (which has type super-interface), and an assignment of the
delegate-expression to the synthetic field in the primary constructor,
so that the delegate-expression can be resolved and transformed along
the way.

During Fir2Ir, we look up delegatable members from the super-interface
and generate corresponding functions/properties for the subclass.

TODO: support for generic delegatable members and generic
super-interface.
2020-07-08 09:42:24 +03:00