core: Deduplicate values in `Literal`

Matches the behavior with `typing.Literal`.
pull/369/head
David Mak 2023-12-15 12:26:43 +08:00 committed by sb10q
parent 457d3b6cd7
commit 0bbc9ce6f5
1 changed files with 1 additions and 1 deletions

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)