mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-02 16:21:11 +00:00
add assert
This commit is contained in:
parent
f3b23a6a54
commit
f57e7a6eed
1 changed files with 7 additions and 1 deletions
|
@ -1423,8 +1423,14 @@ pub fn build_exp_expr<'a, 'ctx, 'env>(
|
||||||
Reuse { .. } => todo!(),
|
Reuse { .. } => todo!(),
|
||||||
|
|
||||||
StructAtIndex {
|
StructAtIndex {
|
||||||
index, structure, ..
|
index,
|
||||||
|
structure,
|
||||||
|
field_layouts,
|
||||||
} => {
|
} => {
|
||||||
|
// if you hit this: we unwrap 1-element records, so instead of `x = StructAtIndex 0 y`
|
||||||
|
// you should substitute `x` with `y` in the remainder of the statement
|
||||||
|
debug_assert!(field_layouts.len() > 1, "one-element records are unwrapped");
|
||||||
|
|
||||||
// extract field from a record
|
// extract field from a record
|
||||||
match load_symbol_and_layout(scope, structure) {
|
match load_symbol_and_layout(scope, structure) {
|
||||||
(StructValue(argument), Layout::Struct(fields)) => {
|
(StructValue(argument), Layout::Struct(fields)) => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue