mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 11:52:19 +00:00
Merge pull request #5356 from roc-lang/i5325
Fix repl evaluation of tuples
This commit is contained in:
commit
d84a9fa8ba
2 changed files with 15 additions and 0 deletions
|
@ -621,6 +621,9 @@ fn addr_to_ast<'a, M: ReplAppMemory>(
|
|||
Content::Structure(FlatType::Record(fields, _)) => {
|
||||
struct_to_ast(env, mem, addr, *fields)
|
||||
}
|
||||
Content::Structure(FlatType::Tuple(elems,_)) => {
|
||||
struct_to_ast_tuple(env, mem, addr, *elems)
|
||||
}
|
||||
Content::Structure(FlatType::TagUnion(tags, _)) => {
|
||||
debug_assert_eq!(tags.len(), 1);
|
||||
|
||||
|
|
|
@ -1292,3 +1292,15 @@ fn tuple() {
|
|||
r#"("a", 2) : ( Str, U32 )*"#,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn nested_tuple() {
|
||||
expect_success(
|
||||
indoc!(
|
||||
r#"
|
||||
("a", (2u32, 3u32))
|
||||
"#
|
||||
),
|
||||
r#"("a", (2, 3)) : ( Str, ( U32, U32 )a )a"#,
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue