Commit Graph
4 Commits
Author SHA1 Message Date
kshokhin b6d660b4d9 Add nested array size deduction from tuple (#2909)
As a follow up to #2825 this pr implements size deduction for nested
arrays.
E.g. `var x: [[i32;];] = ((1,2), (3,4));`.

Also updated the pattern matching logic for arrays, now it also checks
element types of the tuple size being deduced from. As a result code
like `var x: [i32;] = ("foo", "bar");`(note, that it tries to init an
array of i32 with a tuple of strings) fails to compile with a pattern
match error instead of an implicit cast failed error.

Moved some common type-related logic used in type_checker.cpp and
interpreter.cpp to the separate file.
2023-11-20 20:20:21 +00:00
Jon Ross-Perkins 357baaeef8 Rename //explorer/common to base (#3103)
Renaming per #3100
2023-08-15 19:23:23 +00:00
Prabhat Sachdeva da35a9806a Explorer: make pattern match trace consistent (#3093)
Makes the trace output for pattern match more consistent with the rest
of the trace by using `Match()` and `Indent()` prefix methods and
wrapping the code in the trace with backticks.
2023-08-12 00:02:41 +00:00
kshokhin d34b3e02c2 Add type_utils file (#2926)
Prerequisite for #2909. Moves some type-related functions to the
separate file.
2023-08-07 16:22:19 +00:00