We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2305c68 commit 0f90d88Copy full SHA for 0f90d88
src/compiler/checker.ts
@@ -8682,7 +8682,7 @@ namespace ts {
8682
// type. Otherwise, the types are completely unrelated, so narrow to an intersection of the
8683
// two types.
8684
const targetType = type.flags & TypeFlags.TypeParameter ? getApparentType(type) : type;
8685
- return isTypeSubtypeOf(candidate, targetType) ? candidate :
+ return isTypeSubtypeOf(candidate, type) ? candidate :
8686
isTypeAssignableTo(type, candidate) ? type :
8687
isTypeAssignableTo(candidate, targetType) ? candidate :
8688
getIntersectionType([type, candidate]);
0 commit comments