Skip to content

Commit

Permalink
use recombineUnknownType
Browse files Browse the repository at this point in the history
  • Loading branch information
Andarist committed Dec 17, 2024
1 parent 6fdf096 commit 042aced
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29404,11 +29404,9 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
if (checkDerived) {
return filterType(type, t => !isTypeDerivedFrom(t, candidate));
}
const originalType = type;
type = type.flags & TypeFlags.Unknown ? unknownUnionType : type;
const trueType = getNarrowedType(type, candidate, /*assumeTrue*/ true, /*checkDerived*/ false);
const filtered = filterType(type, t => !isTypeSubsetOf(t, trueType));
return originalType.flags & TypeFlags.Unknown && filtered === type ? originalType : filtered;
return recombineUnknownType(filterType(type, t => !isTypeSubsetOf(t, trueType)));
}
if (type.flags & TypeFlags.AnyOrUnknown) {
return candidate;
Expand Down

0 comments on commit 042aced

Please sign in to comment.