forked from M-Labs/nac3
1
0
Fork 0

core: Reject multiple literal bounds

This is currently broken due to how we handle function calls in the
unifier.
This commit is contained in:
David Mak 2023-12-18 10:04:01 +08:00
parent 6dccb343bb
commit 9d64e606f4
1 changed files with 8 additions and 1 deletions

View File

@ -341,7 +341,14 @@ pub fn parse_ast_to_type_annotation_kinds<T>(
_ => unreachable!(), _ => unreachable!(),
}) })
.collect_vec(); .collect_vec();
Ok(TypeAnnotation::Literal(type_annotations))
if type_annotations.len() == 1 {
Ok(TypeAnnotation::Literal(type_annotations))
} else {
Err(HashSet::from([
format!("multiple literal bounds are currently unsupported (at {})", value.location)
]))
}
} }
// custom class // custom class