Commit Graph

4 Commits

Author SHA1 Message Date
Brian Norman 17a1871b83 [FIR] Make sure the primary constructor is first in class CFG
The primary constructor of a class needs to be the first subgraph of the
class control-flow graph. Based on the Kotlin specification, class
initialization order goes first primary constructor, in-place
declarations (properties and init blocks), and then secondary
constructors. If the class doesn't have a primary constructor, then it
is just skipped in the order.

Unfortunately, the class control-flow graph had in-place declarations
first and then all constructors. Instead, we should treat the primary
constructor as the first in-place declaration, and then continue with
the existing processing as secondary constructors. This will guarantee
that super constructor calls have the correct property initialization
information.

^KT-65093 Fixed
2024-01-23 23:16:00 +00:00
Ilya Chernikov 90a7f7beac K2 Scripting: fix CFG processing related testdata in compiler 2023-12-12 09:58:19 +00:00
Brian Norman 0881910a1b [FIR] Rewind DFA after call arguments for correct receiver smartcasting
^KT-63709 Fixed
2023-12-08 14:32:22 +00:00
Dmitrii Gridin a1ee07603a [FIR] add cfg dump to script test
^KT-62834
2023-10-24 10:30:55 +00:00