Skip to content

Commit cd7a14a

Browse files
committed
Reuse getSimplifiedTypeOrConstraint function
1 parent b7012b5 commit cd7a14a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/compiler/checker.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -13066,8 +13066,7 @@ namespace ts {
1306613066
}
1306713067
// A type S is assignable to keyof T if S is assignable to keyof C, where C is the
1306813068
// simplified form of T or, if T doesn't simplify, the constraint of T.
13069-
const simplified = getSimplifiedType((<IndexType>target).type, /*writing*/ false);
13070-
const constraint = simplified !== (<IndexType>target).type ? simplified : getConstraintOfType((<IndexType>target).type);
13069+
const constraint = getSimplifiedTypeOrConstraint((<IndexType>target).type);
1307113070
if (constraint) {
1307213071
// We require Ternary.True here such that circular constraints don't cause
1307313072
// false positives. For example, given 'T extends { [K in keyof T]: string }',

0 commit comments

Comments
 (0)