Commit Graph

35 Commits

Author SHA1 Message Date
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
Alexander Udalov 328853dffe Add tests for obsolete issues
(Test for KT-37331 is added to multiplatform/defaultArguments/suspend.kt.)

 #KT-30080
 #KT-33641
 #KT-36237
 #KT-36952
 #KT-37331
 #KT-38920
 #KT-39256
 #KT-42415
 #KT-44636
 #KT-45704
 #KT-47084
 #KT-47894
2022-03-08 14:19:37 +01:00
Mikhail Glukhikh 53d6ac24e5 Switch kotlin version to 1.7
* Change 1.6 to 1.7 constants
* Fix SAFE_CALL_WILL_CHANGE_NULLABILITY for testData
* Change EXPOSED_PROPERTY_TYPE_IN_CONSTRUCTOR_WARNING to EXPOSED_PROPERTY_TYPE_IN_CONSTRUCTOR_ERROR
* Change NON_EXHAUSTIVE_WHEN_STATEMENT to NO_ELSE_IN_WHEN
* Fix testData for SafeCallsAreAlwaysNullable
* Change T -> T & Any in test dumps
* Change INVALID_CHARACTERS_NATIVE_WARNING -> INVALID_CHARACTERS_NATIVE_ERROR
* TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM_WARNING -> TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM_ERROR
2022-02-25 11:46:27 +00:00
Dmitriy Novozhilov 330574cab6 [FIR] Properly support smartcasts on stable when subjects in when conditions
^KT-49860 Fixed
2021-11-26 11:26:21 +03: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
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 fdd7fa5aea [Wasm] Mute codegen box tests 2020-11-09 16:04:43 +03:00
Mark Punzalan b74652aa5b [FIR] Use ieee754equals for floating-point equality operations 2020-04-23 11:50:54 +03:00
Mikhail Glukhikh a4c7619c89 [FIR2IR] Introduce & use FirBuiltInsPackageFragment
Without this commit, JVM name mapping logic in BE does not work for FIR,
because FIR cannot use old BuiltInsPackageFragmentImpl descriptor.
In this commit we add our own implementation thus fixing
a pack of FIR black box tests.
2020-03-24 10:37:53 +03:00
Juan Chen 9dd8eda1c9 [FIR]: fix library methods in packages
Library methods such as 'listOf' are resolved
to have the package fragments as their parents,
but JVM expects their containing file classes as parents.
This fix generates those file classes and
uses them as parent replacements for such library methods.
2020-02-20 14:24:02 +03:00
Juan Chen 7249d2f889 [FIR] Fix translation of invokes & add return expressions for lambdas
* fixed NoSuchMethod caused by mismatched signatures of the "invoke" method generated for lambda arguments
* added test cases in invoke.kt for KFunction and anonymous functions
* added a transformer to wrap the last expression in the bodies of lambdas with return
2020-02-06 12:44:14 +03:00
Mikhail Glukhikh 9c9cf2086d Unmute recently fixed FIR black box tests 2019-11-19 11:00:10 +03:00
Mark Punzalan 9df2f69f09 [FIR] Disable failing blackbox codegen tests for FIR. 2019-11-19 11:00:09 +03:00
Svyatoslav Kuzmich aa811dcfb3 [JS IR BE] Add KJS_WITH_FULL_RUNTIME directive to compiler tests 2019-01-24 16:14:40 +03:00
Dmitry Petrov 7624dbbb20 Fix subject variable handling in specialized enum codegen
#KT-27161
2018-09-27 10:48:35 +03:00
Anton Bannykh 2e709a81fa [JS IR BE] Arrays, varargs 2018-09-18 14:36:20 +03:00
Roman Artemev 8a871b3f0c Update tests 2018-08-31 15:34:18 +03:00
Roman Artemev 6c8e30eb05 Fix test failures
* add metadata
 * unmute working tests
 * mute temporary broken ones
2018-08-09 20:55:50 +03:00
Zalim Bashorov 3c765e3625 [JS BE] Support val in when subject
#KT-25014 Fixed
2018-08-09 16:22:25 +03:00
Mikhael Bogdanov 357359b1dd Unmute ir-tests after CR support 2018-08-09 14:22:50 +03:00
Roman Artemev efec82c0eb Update test data
* add new tests for coroutines
 * add copy of some tests without dependency on stdlib
2018-08-08 18:33:41 +03:00
Svyatoslav Kuzmich 1abb4f42ac [JS IR BE] Add ranges to runtime, rangeTo for primitive numbers 2018-07-17 20:18:29 +03:00
Mikhael Bogdanov e149cbe852 Mute failed jvm ir tests 2018-06-28 12:26:41 +02:00
Dmitry Petrov d546fca876 Enable JS_IR back-end on passing 'when' tests 2018-06-21 12:32:00 +03:00
Dmitry Petrov c312fddb45 Ignore some 'when' subject variable tests in JS_IR be 2018-06-20 14:06:34 +03:00
Dmitry Petrov a7492e91c9 Check that subject expression is evaluated only once 2018-06-20 14:06:34 +03:00
Dmitry Petrov 6194cfc782 Additional IEEE754-related tests for subject variable in 'when' 2018-06-20 14:06:34 +03:00
Dmitry Petrov 34b76a3718 Support subject variable in specialized code generators for 'when' 2018-06-20 14:06:34 +03:00
Dmitry Petrov 6949610dcb 'val' in 'when': IEEE754 equality 2018-06-20 14:06:34 +03:00
Dmitry Petrov d6894091a9 Support 'when' with subject variable in JVM BE 2018-06-20 14:06:34 +03:00