Commit Graph

3412 Commits

Author SHA1 Message Date
Pavel Mikhailovskii 65b2cee913 KT-23397 Optimize out field for property delegate when it's safe (JVM) 2022-06-07 10:46:01 +00:00
Nikolay Lunyak 8d2868da32 [FIR JS] Regenerate tests
вфцвфдцьв
2022-06-02 13:47:34 +00:00
Nikolay Lunyak da8a8a8988 [FIR JS] Add a Fir2IrJsText runner 2022-06-02 13:47:30 +00:00
Nikolay Lunyak bdc3b5fe6f [FIR JS] Mute 170 failing multi-module tests 2022-06-02 13:47:24 +00:00
Nikolay Lunyak ccc72e5125 [FIR JS] Add a FirJsTest runner
Note: 763/1627 failed tests
- 170 are multi-module tests which can be ignored for now
2022-06-02 13:47:24 +00:00
Ilmir Usmanov f922684169 Minor. Add regression test
#KT-52561 Fixed
2022-06-02 13:26:24 +00:00
Denis.Zharkov c1904004c4 FIR: Fix case when smartcast receiver is used for call to private method
^KT-54432 Fixed
2022-06-01 16:02:30 +00:00
Sergej Jaskiewicz e03747ea7d [JS IR] Introduce the GENERATE_INLINE_ANONYMOUS_FUNCTIONS feature flag 2022-06-01 09:02:31 +00:00
Sergej Jaskiewicz c10af22b27 [JS IR] Lower lambdas into in-line anonymous functions when possible
Previously we always generated factories for contextful lambdas:

```kt
fun foo(a: Int) = { a }
```

```js
function foo(a_38) {
  return foo$lambda(a_38);
}

// factory!
function foo$lambda($a) {
  return function () {
    return $a;
  };
}
```

After this patch, the generated code for `foo` is more concise:

```js
function foo(a) {
  return function() { return a; };
}
```
2022-06-01 09:02:30 +00:00
Victor Petukhov 96d1f89836 [BE] Support until operator in back-ends 2022-05-31 08:42:56 +00:00
Pavel Mikhailovskii 2ceccec2b8 KT-52551 Create a static initialization section in case of delegation to a property reference from a file class 2022-05-30 14:16:18 +00:00
Ivan Kochurkin 0ef043b074 [FIR2IR] Consider property init value from nested class, ^KT-52057 Fixed 2022-05-29 23:41:23 +03:00
Victor Petukhov 0199c76c06 [FE 1.0] Check callable reference return type safety during resolution
^KT-51844
^KT-52503 Fixed
2022-05-27 13:56:34 +00:00
Victor Petukhov 51551998c7 Revert "[FE 1.0] Take care callable reference candidates with recursive candidate return type"
This reverts commit d04beaa8bb49c99ceb993f3f7b32169c393b39f4.
2022-05-27 13:56:33 +00:00
Victor Petukhov b411eb36e8 [FE 1.0] Take care standalone lambdas during updating types in the builder inference
^KT-50520 Fixed
2022-05-27 13:56:32 +00:00
Artem Kobzar 8bc5508f5c fix(KT-52339): add newlines to SourceMap to calculate multiline comments in a right way. 2022-05-20 13:35:54 +00:00
Svyatoslav Kuzmich 84ed3ff5b0 [Wasm] Don't generate wat format by default in box tests
Gives ~15% tests speedup
Use kotlin.wasm.debugMode=1 to enable old behaviour
2022-05-20 13:34:28 +00:00
Svyatoslav Kuzmich d1c81eb6ba [Wasm] Support Wasm GC milestone 5 2022-05-20 12:22:43 +03:00
Georgy Bronnikov 39bba7973c Fir2Ir: create file level signatures where appropriate
This is godugly code, where a flag for file level signatures is passsed
around.
An alternative would be not to create file level signatures for toplevel
private clases, since those still need unique names, at least on JVM.
But that would break binary compatibility.
Signatures are due for overhaul anyway. Hopefully this code can be
reverted at that point.
2022-05-19 12:02:43 +02:00
Ivan Kylchik f3252334b2 Move most of ir utils from backend.common to ir.tree 2022-05-18 21:20:03 +03:00
Dmitriy Dolovov deb9039b0f [IR][tests] Add tests for IR linkage issues related to properties 2022-05-18 18:05:05 +03:00
Dmitriy Dolovov 8e8ecc48ad [IR][tests] Add tests for removal-of-abstract-fun IR linkage case
^KT-50771
2022-05-18 18:04:26 +03:00
pyos 513ef575ce JVM: correctly merge typed null values
1. merge(null of type A, null of type B) = null of unknown type;
2. merge(null of type A, something of type B) = merge(unknown null, B).

^KT-52311 Fixed
2022-05-17 11:58:06 +00:00
Svyatoslav Kuzmich 813b600555 [Wasm] Don't write .wat files in box tests
These files take space on CI, but they are not validated or processed
automatically in any way.

Disabled by default, enabled via kotlin.wasm.debugMode=1
2022-05-13 11:20:13 +00:00
Ilmir Usmanov 4f53b085ec Do not override collection stub, if the override is suspend
but the stub is not. The other way around should be OK.

 #KT-52237 Fixed
2022-05-09 23:16:58 +00:00
pyos b19b265735 JVM_IR: generate continuation classes for suspend inline references
This is somewhat suboptimal since this results in `::suspendInline`
generating 2 classes while `{ suspendInline() }` only creates 1, but
it's the best allowed by the existing hierarchy of classes in stdlib. At
least it works?

^KT-50832 Fixed
2022-05-09 23:15:05 +00:00
Victor Petukhov 9f31f074da [FE 1.0] Take care callable reference candidates with recursive candidate return type
^KT-51844 Fixed
2022-05-09 19:23:43 +00:00
Victor Petukhov 7675361380 [FE 1.0] Continue completion of calls inside that builder inference call postponed type variables of which has already been inferred 2022-05-09 12:38:39 +00:00
Victor Petukhov 6027c2a9aa [FE] Substitute fixed type variables with inferred stub types
Actually, a type variable might be fixed into a stub type. Such stub type should be substituted before sub calls completion

^KT-51988 Fixed
2022-05-09 12:38:37 +00:00
Alexander Udalov 6d664bcd10 JVM IR: fix operand type for CompareTo intrinsic
It's incorrect to take the first parameter type from the expression
itself because it can be nullable if smart casts are used. And if it's
nullable, it's mapped to the wrapper type and calling
`comparisonOperandType` for it makes no sense. Instead, take the type
from the callee function, as it's guaranteed to be mapped to a JVM
primitive type.

E.g. in `test1` function in the added test, the problem was that the
dispatch receiver type of the call expression is `Double?`, which is
mapped to `java/lang/Double`, whereas we clearly wanted to obtain the
primitive `D` (double) type.

 #KT-52163 Fixed
2022-05-05 23:06:21 +02:00
Zalim Bashorov f8ef028da3 [Wasm] Remove no longer existed dirs from exclude list 2022-05-05 21:03:40 +00:00
Zalim Bashorov e594cad02a [Wasm] Add tests from "boxInline" 2022-05-05 21:03:38 +00:00
Zalim Bashorov 2c20a71d08 [Codegen tests] Specify JVM as target backend for inferenceFlexibleTToNullable.kt 2022-05-05 21:03:37 +00:00
Zalim Bashorov db4888b3d4 [Wasm] Stop excluding a bunch of tests 2022-05-05 21:03:34 +00:00
Alexander Korepanov 9e591f3299 [JS IR] Add a test for external property accessor with a side effect. 2022-05-04 13:14:07 +00:00
Alexander Korepanov 57f16e801f [JS IR] Materialize Unit more aggressively for IrCalls
Unit materialization for IrCall is required for operations with dynamic type.

However it produces useless Unit_getInstance() calls,
especially in return expressions. The pach also adds some heuristics
for reducing the amount of Unit_getInstance() calls from return expressions:
do not add Unit_getInstance() if return value has Unit type.

Relaited to KT-51139
^KT-23252 Fixed
2022-05-04 13:14:06 +00:00
Ilya Goncharov 1fc7fbed79 rra/ilgonmic/export-call-site
[JS IR] Add test with exported overridden property from interface

[JS IR] Accessors should not be exported when overridden from non-exported interface

Merge-request: KT-MR-6166
Merged-by: Ilya Goncharov <Ilya.Goncharov@jetbrains.com>

^KT-52144 fixed
2022-04-29 12:13:09 +00:00
Victor Petukhov fb76d819f0 [FE] Erase type parameters of super types during intersection type emptiness check as well 2022-04-27 19:50:27 +00:00
Victor Petukhov 0f1d212fc5 [FE] Fix tests 2022-04-27 19:50:27 +00:00
Artem Kobzar ccc2aae841 fix(KT-50270): inline properties accessor for child classes too. 2022-04-27 10:21:38 +00:00
Igor Laevsky 3de1235fda [WASM] Add command line option to enable/disable assertions 2022-04-26 20:41:52 +00:00
Zalim Bashorov 90c867ae1d [JS] Define Node.js version in one place and use a single version everywhere
Consequently, it fixes the inability to run some JS related tests on Apple devices with ARM.
2022-04-23 17:58:42 +02:00
Zalim Bashorov 2ed3349f7b [JS] Support downloading v8 for mac-arm64 2022-04-23 14:06:24 +02:00
Artem Kobzar 7327bc864e test(KT-31614): fixate behavior of serialization/deserialization of UTF characters. 2022-04-21 09:22:24 +00:00
Artem Kobzar 59bd2fbb91 test(KT-51066): fixate behavior of value classes in composition with suspend lambdas. 2022-04-20 15:49:09 +00:00
Artem Kobzar 333440dfc6 fix: function inlining without blocks for else statement. 2022-04-20 09:28:45 +00:00
Vyacheslav Gerasimov d9e8f0c180 Build: Rework test workers calculation with respect to available memory
#KTI-787
2022-04-19 11:45:23 +00:00
Alexander Likhachev 899964ba30 [Build] Update gradle-node-plugin to 3.2.1
#KT-44611 In Progress
2022-04-19 00:39:21 +03:00
Anton Bannykh 281e381223 JS IR: materialize Unit in lambdas
^KT-52010 fixed
2022-04-16 09:59:51 +03:00
Alexander Korepanov d908eb6e84 [JS IR] Fix callable references ignoring bound parameters
^KT-51102 Fixed
2022-04-14 13:48:19 +00:00