From cd7a14ac21974209fc870642e6d1489a66f91af1 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Wed, 22 May 2019 17:22:33 -0700 Subject: [PATCH] Reuse getSimplifiedTypeOrConstraint function --- src/compiler/checker.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 }',