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
parent f742d0c32d
commit bf830f216e
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)