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; };
}
```
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.
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
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
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
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
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
[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