mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 08:34:33 +00:00
Give an error instead of panicking on an empty tuple type
This commit is contained in:
parent
861f9c5d47
commit
cbd6d50584
5 changed files with 35 additions and 25 deletions
|
@ -887,7 +887,9 @@ fn can_annotation_help(
|
|||
"tuples should never be implicitly inferred open"
|
||||
);
|
||||
|
||||
debug_assert!(!elems.is_empty()); // We don't allow empty tuples
|
||||
if elems.is_empty() {
|
||||
env.problem(roc_problem::can::Problem::EmptyTupleType(region));
|
||||
}
|
||||
|
||||
let elem_types = can_assigned_tuple_elems(
|
||||
env,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue