Commit Graph

6128 Commits

Author SHA1 Message Date
Ilmir Usmanov 3f8fa3149b Support extensions in functional supertypes
Under a flag for now.
2021-10-18 18:53:26 +03:00
Sergej Jaskiewicz 9e5520bba8 [JS IR & WASM] Fix executing init blocks for enums with nested objects 2021-10-18 13:37:16 +00:00
Anton Bannykh 283e37c741 [JS IR] fix warnings 2021-10-15 20:14:54 +03:00
Anton Bannykh c2f7ed2fff [JS IR] added a directive to skip IC checks in IR 2021-10-15 20:14:53 +03:00
Anton Bannykh 546ce501cb [JS IR] run IC box tests 2021-10-15 20:14:51 +03:00
Anton Bannykh b1b88a0d11 [JS IR] JS AST serialization 2021-10-15 20:14:50 +03:00
Anton Bannykh 936383254a [JS IR] explicitly mark JsName's temporary or not 2021-10-15 20:14:49 +03:00
Sergej Jaskiewicz 8b2410733f [JS IR] Improve the test for exporting protected members 2021-10-15 12:52:11 +00:00
Svyatoslav Kuzmich 0f66f85cf9 [Wasm] Support main function 2021-10-15 13:58:55 +03:00
Artem Kobzar 99688e5c80 test(KT-47096): add tests for the uncovered behavior. 2021-10-14 14:57:35 +00:00
Igor Laevsky 50ca86838f [WASM] Fix build 2021-10-14 17:24:07 +03:00
Igor Laevsky bede039c08 [Wasm] Add compiler support for the kotlin.test library 2021-10-14 17:24:05 +03:00
Igor Laevsky dcdc7e4633 [Wasm] Add box tests for kotlin.test 2021-10-14 17:24:03 +03:00
Dmitry Petrov 6ba65065ee JVM add tests for KT-48544 & KT-49226 2021-10-14 17:23:12 +03:00
Sergej Jaskiewicz 55ae6d1f3e [JS IR] Optimize pattern-matching of enums into comparing their ordinals
For this code:
```
enum class Season {
    WINTER,
    SPRING,
    SUMMER,
    AUTUMN
}

fun bar1(x : Season) : String {
    return when (x) {
        Season.WINTER, Season.SPRING -> "winter_spring"
        Season.SUMMER -> "summer"
        else -> "autumn"
    }
}
```

previously we generated this:
```
function foo(x) {
    var tmp0_subject = x;
    return (tmp0_subject.equals(Season_WINTER_getInstance())
        ? true
        : tmp0_subject.equals(Season_SPRING_getInstance()))
            ? 'winter_spring'
            : tmp0_subject.equals(Season_SUMMER_getInstance())
                ? 'summer'
                : 'autumn';
}
```

And now we generated this:
```
function bar2(x) {
  var tmp0_subject = x;
  var tmp0 = tmp0_subject._get_ordinal__0_k$();
  var tmp;
  switch (tmp0) {
    case 0:
    case 1:
      tmp = 'winter_spring';
      break;
    case 2:
      tmp = 'summer';
      break;
    case 3:
      tmp = 'autumn';
      break;
    default:
      noWhenBranchMatchedException();
      break;
  }
  return tmp;
}
```
2021-10-14 11:44:01 +00:00
Dmitry Petrov 6f33259bc3 PSI2IR KT-49203 INVISIBLE_FAKE setter is non-referenceable 2021-10-13 18:38:23 +03:00
Artem Kobzar f645c89ebf fix(KT-43191): add static qualifier for Companion and non-inner objects. 2021-10-13 11:09:59 +00:00
Svyatoslav Kuzmich 90dd0c6150 [JS] Fix and mute failed tests on TC 2021-10-13 01:26:27 +03:00
Svyatoslav Kuzmich 279f184703 [JS] Remove failed checks based on unstable naming 2021-10-12 23:29:39 +03:00
Svyatoslav Kuzmich 3f8dce4b53 [JS IR] Support per-file mode and ES modules 2021-10-12 23:29:39 +03:00
Svyatoslav Kuzmich f479ac5c3a Remove implementation specific access to _ from test
Operator `new` is already tested with String class
2021-10-12 23:01:01 +03:00
Sergej Jaskiewicz 1f0b691ab6 [JS] Fix some JS prettyprinting
- Print a newline after `default` case in `switch`es
- Print a newline after `if` blocks without corresponding `else` blocks
2021-10-12 13:38:56 +00:00
Svyatoslav Kuzmich 20cc7196c8 [Wasm][Minor] Remove unused doTestWithCoroutinesPackageReplacement 2021-10-12 08:42:00 +03:00
Svyatoslav Kuzmich 3bd0ea6b07 [Wasm] Support generating browser-compatible directory 2021-10-12 08:42:00 +03:00
Svyatoslav Kuzmich 15acc412ba [Wasm] Update testdata after coroutines support 2021-10-12 08:42:00 +03:00
Sergej Jaskiewicz 9ee8f1e961 [JS IR] Enable StringTrimLowering for JS IR backend 2021-10-11 15:57:53 +00:00
Ilya Goncharov b0aefd543a [JS IR] Fix offsets and add new test
[JS IR] Use TypeSubstitutor for full substitution of types

- adding new tests

[JS IR] Commonize context and use in wasm

[JS IR] Add test with receiver with callable reference

[JS IR] Add prerequisites around inlining and callable references

[JS IR] Review fixes

- Add test with bounded type parameter
- Remove redundant casts
- Use offsets for synth function
- Correct traversing

[JS IR] Not use origin for not inlined function reference

[JS IR] Move util into common place

[JS IR] Fix offsets

[JS IR] Add type parameter argument and using value in test

[JS IR] Wrap inlined callable references with reified parameters

[JS IR] Add test on callable reference inlined fun

Merge-request: KT-MR-4722
2021-10-11 09:02:08 +00:00
Artem Kobzar c9510af2c7 test(KT-47806): add tests for the uncovered behavior for generic companion function extensions. 2021-10-11 08:56:52 +00:00
Artem Kobzar dca4a8e722 fix(KT-45056, KT-47516): use enum as an IR class instead of enum entity class. 2021-10-08 16:21:49 +00:00
Roman Artemev 876a0d9b7b [IR] Add test about default arguments in expect declaration for HMMP
KT-45542
2021-10-08 16:07:10 +03:00
Ilya Goncharov 669965d56c [JS IR] Generate main method call only for main module 2021-10-08 10:08:57 +00:00
Dmitry Petrov 27860ef008 JVM_IR KT-49136 don't optimize null checks on fields and calls 2021-10-08 08:55:24 +03:00
Roman Artemev 7eb0fd4762 [JS IR] Unmute fixed tests 2021-10-07 16:00:50 +03:00
Roman Artemev ed8e7c754d [IR] Add test for internal fake overrides from friend module 2021-10-07 16:00:48 +03:00
Roman Artemev 9138425a3d [JS IR] Pass friend dependencies to compiler in test runner 2021-10-07 16:00:47 +03:00
Sergej Jaskiewicz 65d40c2253 [JS IR] Make tests that use directives pass with IR BE 2021-10-06 09:23:50 +00:00
Sergej Jaskiewicz a359e503fb [JS tests] Introduce the CHECK_FUNCTION_EXISTS directive 2021-10-06 09:23:50 +00:00
Sergej Jaskiewicz c84f9cde07 [JS] Check the DECLARES_VARIABLE directive for all matching functions
Not just the first one.
2021-10-06 09:23:49 +00:00
Sergej Jaskiewicz 103be8f7bc [JS] Don't fail the test after the first directive check fails 2021-10-06 09:23:49 +00:00
Sergej Jaskiewicz 09467954bc [JS] Allow per-backend directives in JS tests
This way we can use different directives for the legacy and IR backends.
2021-10-06 09:23:49 +00:00
Sergej Jaskiewicz b93e0181ca [JS IR] Enable directives for IR box tests 2021-10-06 09:23:48 +00:00
Roman Artemev 8f8c59e748 [JS IR] Fix passing abiVersion to compiler in tet runner 2021-10-06 03:47:18 +03:00
Roman Artemev 1d39b37c90 [IR] Add test describes case from KT-48912
It actually doesn't check behaviour because we don't have proper infra
for that but explains a bit a problem for further investigations.
2021-10-06 03:47:17 +03:00
Denis.Zharkov 0a3c950e7f FIR: Fix resolution scope of constructor delegation calls 2021-10-05 13:48:53 +03:00
Igor Chevdar 232608e300 [box-tests] Added a test 2021-10-04 14:34:56 +00:00
Svyatoslav Kuzmich c88cde2f8b [Wasm] DONT_TARGET_WASM_BACKEND => IGNORE_BACKEND in testdata 2021-10-02 06:14:35 +00:00
Roman Artemev 0621b79505 Add test for KT-46225 2021-10-01 23:36:40 +03:00
Roman Artemev 38f21b7139 [JS IR] Add test to check proper type substitution 2021-10-01 23:02:24 +03:00
Roman Artemev 23cba59b90 [JS IR] Unmute fixed test 2021-10-01 23:02:22 +03:00
Roman Artemev 693a5740c1 [JS IR] Disable pir tests by default 2021-10-01 23:02:11 +03:00