Commit Graph

6651 Commits

Author SHA1 Message Date
Svyatoslav Kuzmich f833fc4bcb [Wasm] Default parameter values for external functions
+ import top-level external functions wrapped in lambdas
2021-11-17 19:28:14 +00:00
Dmitry Petrov 30ceb49442 JVM_IR KT-48945 generate special bridge with unsubstituted signature 2021-11-17 17:44:01 +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
Alexander Udalov 850d76f6bf Remove error on annotated types as arguments to typeOf
Instead, document that `KType.annotations` returns an empty list for
types created with `typeOf`. Annotations might be supported in the
future.

 #KT-49573 Fixed
 #KT-29919
2021-11-16 15:02:50 +01:00
Igor Yakovlev a7f0f62f69 [WASM] Generate missing WASM tests and mute failing ones 2021-11-15 19:53:49 +03:00
Igor Yakovlev ee7f4c7278 [WASM] Implementation typeOf support 2021-11-15 19:53:48 +03:00
Igor Yakovlev ce360bb10b [WASM] Implementation of Class references 2021-11-15 19:53:46 +03:00
Igor Yakovlev d9f2bd7963 Revert "[Wasm][Temporary] Stubs for typeOf and ::class constructs"
This reverts commit 8dc81b6c57.
2021-11-15 19:53:45 +03:00
Steven Schäfer a6dae0b37b JVM IR: Fix value class mangling in SAM wrappers from different modules
KT-49659
2021-11-14 21:52:39 +01:00
zhelenskiy c1dc1f7e33 Diagnostics renamed
Signed-off-by: zhelenskiy <zhelenskiy2000@yandex.ru>
2021-11-13 12:38:45 +01:00
Mikhail Glukhikh d6bc6bec59 FIR2IR: read extension function type attribute properly 2021-11-12 12:53:32 +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
Dmitriy Dolovov 1e8dbd4846 [Native][tests] Add ExperimentalContracts OPT_IN directive for kt47300.kt
Without this directive the test can't be compiled by Kotlin/Native, because the box() function which is annotated with @ExperimentalContracts is called from the generated test runner source code that itself is not marked by this annotation.
2021-11-11 12:33:00 +03:00
Alexander Udalov 27cfcb9b3d IR: fix thisReceiver parameter type for function classes
Incorrect builder was used at line 269, which led to non-sensible type
in `IrClass.thisReceiver` for function types, such as
`SuspendFunction1<SuspendFunction1, SuspendFunction1>` in the linked
issue.

Avoid creating types manually completely to simplify this code and fix
the bug.

 #KT-49168 Fixed
2021-11-10 21:58:41 +01:00
Denis.Zharkov 65d7da122f FIR: Fix invalid INITIALIZER_TYPE_MISMATCH for suspend lambda 2021-11-10 22:00:01 +03:00
Svyatoslav Kuzmich 03c352c11e [Wasm] Lower complex external declarations
- Properties
- Member functions
- Object declarations
- Constructors
- Classes with instance checks
2021-11-10 19:48:11 +03:00
Svyatoslav Kuzmich c0761bf34a [Wasm] Support callable references to external functions
1. Move jsInteropFunctionsLowering after callable reference lowering,
  so it can continue to deal with just functions and function calls.
2. Generate lowered closure class in JsInteropFunctionsLowering because
2021-11-10 19:48:10 +03:00
Dmitry Petrov 916379c0e7 JVM KT-49613 use adapter for indy reference to protected constructor 2021-11-10 19:37:27 +03:00
Dmitry Petrov 76bdf4ff1a JVM KT-49548 extra test 2021-11-10 19:37:25 +03:00
Dmitry Petrov 9a4cff0dc7 JVM KT-49548 progression iterators can be tainted 2021-11-10 19:37:24 +03:00
Mads Ager 604f217360 [FIR] Report properties from java methods in Fir2IrLazyClass.
This shows up in annotation instantiation tests where we need
to make sure to generate a property on the annotation implementation
class for such properties.
2021-11-09 23:51:49 +03:00
Mads Ager b79ca7d7df [FIR] Allow annotation instantiation.
This commit disables the frontend error reporting for supported cases.
2021-11-09 23:51:48 +03:00
Alexander Udalov 1071919706 Remove backend tests on old inference
Also remove any mentions of NewInference, and rename some tests.
2021-11-09 20:07:33 +01:00
Mikhail Glukhikh 6eaeada1e6 FIR: cache properties in use-site scope properly 2021-11-09 21:04:40 +03:00
Mikhail Glukhikh f2c734fc02 FIR2IR: add another fallback for simple synthetic property 2021-11-09 21:04:39 +03:00
Mikhail Glukhikh b50350f6a5 FIR2IR: add fallback for a synthetic property override situation 2021-11-09 21:04:39 +03:00
Mikhail Glukhikh a05244eca1 FIR: don't enhance synthetic property if not needed 2021-11-09 21:04:38 +03:00
Mikhail Glukhikh 5a44fda42c FIR2IR: bind fake override calls via symbol table 2021-11-09 21:04:37 +03:00
Mikhail Glukhikh 0622a47493 FIR2IR: implement early f/o overridden symbols binding #KT-42784 Fixed
Related to KT-49288
2021-11-09 21:04:36 +03:00
Mikhail Glukhikh 5b6e21690b FIR2IR: call fake overrides properly #KT-49288 Fixed 2021-11-09 21:04:35 +03:00
Dmitry Petrov 271368ac53 JVM_IR prefer loop with inclusive bound for unsigned integer ranges
In general, we would rather prefer a range-based for loop to look like
a counter loop in Java ('for (i = start; i < end; ++i) { <BODY> }').
This corresponds to

    i = start;
    do {
        if (i >= end) break;
        <BODY>
    } while ( { ++i; true } )

However, HotSpot doesn't recognize Kotlin unsigned integer comparison
in 'if (i >= end) break;' as a counter loop condition. Thus, the loop
doesn't get optimized as a counter loop, resulting in a performance
regression.
If we use exclusive range-based for loop instead, then we actually use
unsigned integer equality instead of unsigned integer comparison, which
is Ok for HotSpot.

KT-49444
2021-11-09 13:25:06 +03:00
Mads Ager e1f6c19c83 [FIR] Fix local variable tests.
- Mangle names for extension receivers in lambdas
 - Correctly mark anonymous variables and variables for arguments
   for destructuring declaration.

There is one failure remaining which is cause by lambda
type inference differences that leads to FIR having an explicit
return from the lambda whereas old frontend leads to an implicit
return. This difference is visible in debug stepping that the
local variables tests do because the implicit return has the line
number of the closing brace of the lambda. This change adds an
IrText test to make the difference clear.
2021-11-09 11:09:11 +03:00
Ivan Kylchik ef8199718e [JS TESTS] Move externals.js into main module in functionTypes.kt 2021-11-08 23:50:35 +03:00
Ivan Kylchik 982d10d127 [TESTS] Add IGNORE_ERROR directive to boxError tests
This is needed because now these tests use new test infrastructure
and here, after frontend facade, there is error check. We need to
disable such check in these tests.
2021-11-08 23:50:34 +03:00
Ivan Kylchik 9628412ff4 [TESTS] Remove ignore directive from some of tailrec tests for JS IR 2021-11-08 23:50:34 +03:00
Ivan Kylchik edd608446e [TESTS] Move WITH_RUNTIME directive to file level 2021-11-08 23:50:34 +03:00
Igor Laevsky 0915dac1f9 [Wasm] Handle unsigned arrays in the vararg lowering 2021-11-03 18:50:06 +03:00
Igor Laevsky 8dc81b6c57 [Wasm][Temporary] Stubs for typeOf and ::class constructs 2021-11-03 16:23:01 +03:00
Mads Ager 6622846bc1 [JVM IR] Do not put destructuring params or underscores in LVT.
Putting them in the local variable table means that the debugger
needs to have special handling for parameters with specific names.
That forces us to generate mangled names for these.

Instead of also implementing the name mangling for FIR, this
change gets rid of the parameters from the LVT instead.
2021-11-02 15:13:14 +03:00
Sergej Jaskiewicz 42c213d950 [JS IR] Explicitly convert Long values to String in string concatenation
#KT-39891 Fixed
2021-11-02 10:42:28 +00:00
Mads Ager 41aa0a7c7f [FIR] Fix line number differences between psi2ir and fir2ir. 2021-11-01 15:43:13 +03:00
Mikhael Bogdanov afc149d460 JvmDefault. Allow non default inheritance with special flag
#KT-47000
2021-11-01 13:30:57 +01:00
Victor Petukhov b7a9a7d922 Make backTicked.kt test more reasonable, though real invoking the passed lambda 2021-11-01 13:03:41 +03:00
Victor Petukhov 5508d40371 Put using underscored type arguments under a feature 2021-11-01 12:25:45 +03:00
Victor Petukhov b69fb6779f Basic support of partially specified type arguments though a new underscore operator for type arguments
^KT-13394
2021-11-01 12:25:07 +03:00
Artem Kobzar 979e9f94ef feat(Escaped Identifiers): add ability to use any symbol wrapped in back ticks. 2021-10-29 17:55:59 +00:00
Dmitry Petrov 4f0c3c3c0d JVM_IR never generate setter synthetic accessor for 'val' field
KT-49316
2021-10-29 18:38:11 +03:00
Georgy Bronnikov 534beb8553 IR: Test for toSkip(this) in T.resolveFakeOverride()
^KT-49371 Fixed
2021-10-29 12:13:57 +03:00
Svyatoslav Kuzmich a13329fc65 [JS IR] Regenerate and mute test 2021-10-28 22:39:09 +03:00
Artem Kobzar 790e8843f9 fix(JS_IR): add outer classes resolving inside the function inliner. 2021-10-28 17:34:58 +00:00