From 9d64e606f4c1e32e16c803f5bfb816e76eaa86c1 Mon Sep 17 00:00:00 2001 From: David Mak Date: Mon, 18 Dec 2023 10:04:01 +0800 Subject: [PATCH] core: Reject multiple literal bounds This is currently broken due to how we handle function calls in the unifier. --- nac3core/src/toplevel/type_annotation.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/nac3core/src/toplevel/type_annotation.rs b/nac3core/src/toplevel/type_annotation.rs index 3cd2f25d..4482bc57 100644 --- a/nac3core/src/toplevel/type_annotation.rs +++ b/nac3core/src/toplevel/type_annotation.rs @@ -341,7 +341,14 @@ pub fn parse_ast_to_type_annotation_kinds( _ => unreachable!(), }) .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