We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5c16cb6 commit 709b4ebCopy full SHA for 709b4eb
1 file changed
src/compiler/checker.ts
@@ -8665,7 +8665,7 @@ namespace ts {
8665
// type. Otherwise, the types are completely unrelated, so narrow to an intersection of the
8666
// two types.
8667
const targetType = type.flags & TypeFlags.TypeParameter ? getApparentType(type) : type;
8668
- return isTypeSubtypeOf(candidate, targetType) ? candidate :
+ return isTypeSubtypeOf(candidate, type) ? candidate :
8669
isTypeAssignableTo(type, candidate) ? type :
8670
isTypeAssignableTo(candidate, targetType) ? candidate :
8671
getIntersectionType([type, candidate]);
0 commit comments