diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index bd8d4c05901c7..386beb7f24dd7 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -13066,8 +13066,7 @@ namespace ts { } // A type S is assignable to keyof T if S is assignable to keyof C, where C is the // simplified form of T or, if T doesn't simplify, the constraint of T. - const simplified = getSimplifiedType((target).type, /*writing*/ false); - const constraint = simplified !== (target).type ? simplified : getConstraintOfType((target).type); + const constraint = getSimplifiedTypeOrConstraint((target).type); if (constraint) { // We require Ternary.True here such that circular constraints don't cause // false positives. For example, given 'T extends { [K in keyof T]: string }',