From 0bbc9ce6f52555fc1a4dfdbcc66389bf24d6f4f7 Mon Sep 17 00:00:00 2001 From: David Mak Date: Fri, 15 Dec 2023 12:26:43 +0800 Subject: [PATCH] core: Deduplicate values in `Literal` Matches the behavior with `typing.Literal`. --- nac3core/src/typecheck/typedef/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nac3core/src/typecheck/typedef/mod.rs b/nac3core/src/typecheck/typedef/mod.rs index 41a5e233..d275d8a7 100644 --- a/nac3core/src/typecheck/typedef/mod.rs +++ b/nac3core/src/typecheck/typedef/mod.rs @@ -388,7 +388,7 @@ impl Unifier { loc: Option, ) -> Type { let ty_enum = TypeEnum::TLiteral { - values: values.clone(), + values: values.into_iter().dedup().collect(), loc }; self.add_ty(ty_enum)