Skip to content

Commit

Permalink
Remove fix for keyof types, fixed by microsoft#27157
Browse files Browse the repository at this point in the history
  • Loading branch information
jack-williams committed Sep 18, 2018
1 parent a55d6fb commit b6a836a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15277,8 +15277,7 @@ namespace ts {
impliedType = getAssignmentReducedType(impliedType as UnionType, getBaseConstraintOfType(type) || type);
}
if (isTypeSubtypeOf(impliedType, type)) {
// Intersection to handle `string` being a subtype of `keyof T`
return type.flags & TypeFlags.Any ? impliedType : getIntersectionType([type, impliedType]);
return impliedType;
}
if (type.flags & TypeFlags.Instantiable) {
const constraint = getBaseConstraintOfType(type) || anyType;
Expand Down

0 comments on commit b6a836a

Please sign in to comment.