File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -3216,11 +3216,11 @@ namespace ts {
3216
3216
}
3217
3217
}
3218
3218
3219
- // A variable declared in a for..in statement is always of type string
3219
+ // A variable declared in a for..in statement is of type string, or of type keyof T when the
3220
+ // right hand expression is of a type parameter type.
3220
3221
if (declaration.parent.parent.kind === SyntaxKind.ForInStatement) {
3221
- // const indexType = getIndexType(checkNonNullExpression((<ForInStatement>declaration.parent.parent).expression));
3222
- // return indexType.flags & TypeFlags.Index ? indexType : stringType;
3223
- return stringType;
3222
+ const indexType = getIndexType(checkNonNullExpression((<ForInStatement>declaration.parent.parent).expression));
3223
+ return indexType.flags & TypeFlags.Index ? indexType : stringType;
3224
3224
}
3225
3225
3226
3226
if (declaration.parent.parent.kind === SyntaxKind.ForOfStatement) {
You can’t perform that action at this time.
0 commit comments