mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 05:49:08 +00:00
allow list of empty record in repl
This commit is contained in:
parent
5d59a32938
commit
a4d7e809d2
2 changed files with 8 additions and 0 deletions
|
@ -305,6 +305,9 @@ fn ptr_to_ast<'a>(
|
|||
let (tag_name, payload_vars) = tags.iter().next().unwrap();
|
||||
single_tag_union_to_ast(env, ptr, field_layouts, tag_name.clone(), payload_vars)
|
||||
}
|
||||
Content::Structure(FlatType::EmptyRecord) => {
|
||||
struct_to_ast(env, ptr, &[], &MutMap::default())
|
||||
}
|
||||
other => {
|
||||
unreachable!(
|
||||
"Something had a Struct layout, but instead of a Record type, it had: {:?}",
|
||||
|
|
|
@ -199,6 +199,11 @@ mod repl_eval {
|
|||
expect_success("[]", "[] : List *");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn literal_empty_list_empty_record() {
|
||||
expect_success("[ {} ]", "[ {} ] : List {}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn literal_num_list() {
|
||||
expect_success("[ 1, 2, 3 ]", "[ 1, 2, 3 ] : List (Num *)");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue