core: Deduplicate values in Literal

Matches the behavior with `typing.Literal`.
This commit is contained in:
David Mak 2023-12-15 12:26:43 +08:00 committed by sb10q
parent 457d3b6cd7
commit 0bbc9ce6f5

View File

@ -388,7 +388,7 @@ impl Unifier {
loc: Option<Location>,
) -> Type {
let ty_enum = TypeEnum::TLiteral {
values: values.clone(),
values: values.into_iter().dedup().collect(),
loc
};
self.add_ty(ty_enum)