Give an error instead of panicking on an empty tuple type

This commit is contained in:
Joshua Warner 2024-12-08 10:11:15 -08:00
parent 861f9c5d47
commit cbd6d50584
No known key found for this signature in database
GPG key ID: 89AD497003F93FDD
5 changed files with 35 additions and 25 deletions

View file

@ -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,