Skip to content

Commit

Permalink
fix(type): ensure types have names before comparing in isSameType fun…
Browse files Browse the repository at this point in the history
…ction

Fixes failing `basic union with number | uuid` test in bson package
  • Loading branch information
marcus-sa committed Sep 13, 2023
1 parent 58a9564 commit 22ab510
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/type/src/lib/reflection/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ export function isSameType(a: Type, b: Type, stack: StackEntry[] = []): boolean

try {
if (a.kind !== b.kind) return false;
if (a.typeName !== b.typeName) return false;
if (a.typeName && b.typeName && a.typeName !== b.typeName) return false;
if (a.kind === ReflectionKind.infer || b.kind === ReflectionKind.infer) return false;

if (a.kind === ReflectionKind.literal) return a.literal === (b as TypeLiteral).literal;
Expand Down

0 comments on commit 22ab510

Please sign in to comment.