Commit Graph

16 Commits

Author SHA1 Message Date
Ivan Kylchik c82bc8f0ce [WASM] Add ConstEvaluationLowering to the lowering list 2023-11-22 14:54:19 +00:00
Mikhail Glukhikh b7b7dd1000 FIR2IR: make sources of qualified accesses & calls closer to PSI2IR
#KT-60111 Fixed
2023-10-13 15:42:58 +00:00
Ivan Kylchik abc061e17f [IR] Restore and fix ifConstVal test
It was accidentally dropped after KT-55196 fix.
2023-09-05 11:06:43 +00:00
Nikolay Lunyak 73b4a81663 [FIR] Forbid complex boolean expressions
Disabling the language feature is supported,
otherwise there are too many tests that
would need to be updated to account for
K2's inability to do it.

The `ifConstVal.kt` test is deleted,
because now it must also be ignored in K2,
and since it is ignored for both the
frontends, and the ignored backends
include all the target backends, this test
is basically unused.

Note that now both the frontends report
`CONST_VAL_WITH_NON_CONST_INITIALIZER`.
for `condition`.

^KT-55196 Fixed
2023-08-18 15:16:13 +00:00
Ivan Kylchik 88191e8b1a [IR] Add new test to check that nullable access to enum is not evaluated
Just a safety check. If an expression like `EnumClass.Value?.name` was
evaluated, we would consider it as breaking change.
2023-07-27 22:50:21 +00:00
Ivan Kylchik ad6332112e [IR] Support const optimizations for Native backend 2023-07-10 13:19:51 +00:00
Ivan Kylchik d3d28783c5 [IR] Support const optimizations for JS backend 2023-07-06 11:00:14 +00:00
Ivan Kylchik 8067df3c94 [IR] Combine IrInterpreterNameCheck with common one
This way we achieve faster compilation time. We want to traverse
IR tree as little as possible. If we add new checker than the time
to evaluate constants basically doubles.

#KT-58923
2023-06-14 19:02:39 +00:00
Ivan Kylchik fc75402f65 [IR] Add test to specify new logic of enum initialization with name call
#KT-58948
#KT-57538
2023-05-30 15:28:04 +00:00
Ivan Kylchik e0e1d57120 [IR] Check object init was called in case of name interpretation
#KT-58717 Fixed
2023-05-18 18:16:54 +00:00
Ivan Kylchik 70560fc3eb [IR] Handle each interpreter checker one by one
This wy we can interpret all expressions like `A::a.name` at first and
after that evaluate all complex expressions like
`A::a.name + A::b.name`.
2023-05-18 18:16:54 +00:00
Ivan Kylchik e58e20fc7b [IR] Add special preprocessors for ir interpreter
These preprocessors allow us to modify IR at first and only after that
try to evaluate. With this we can drop `KCallableNamePropertyLowering`.
2023-05-18 18:16:54 +00:00
Ivan Kylchik 1fd8ef801e [IR] Create special checker that will analyze name methods
We can insert all this logic into `IrCompileTimeChecker` but it is
a little bit specific and looks like it is nicer to just extract it.
2023-05-18 18:16:54 +00:00
Ivan Kylchik 6b75b3bc4a [IR] Drop duplicated meta info from interpreters tests 2023-04-19 13:52:48 +00:00
Ivan Kylchik 3f60c83921 [IR] Add id method in interpreter's tests to avoid optimizations 2023-04-19 13:52:48 +00:00
Ivan Kylchik 621f5a0fb7 [IR] Reorganize test files in involvesIrInterpreter dir 2023-04-19 13:52:48 +00:00