We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2a6575c commit 21166f4Copy full SHA for 21166f4
src/compiler/checker.ts
@@ -3233,9 +3233,15 @@ namespace ts {
3233
writer.writeStringLiteral(literalTypeToString(<LiteralType>type));
3234
}
3235
else if (type.flags & TypeFlags.Index) {
3236
+ if (flags & TypeFormatFlags.InElementType) {
3237
+ writePunctuation(writer, SyntaxKind.OpenParenToken);
3238
+ }
3239
writer.writeKeyword("keyof");
3240
writeSpace(writer);
3241
writeType((<IndexType>type).type, TypeFormatFlags.InElementType);
3242
3243
+ writePunctuation(writer, SyntaxKind.CloseParenToken);
3244
3245
3246
else if (type.flags & TypeFlags.IndexedAccess) {
3247
writeType((<IndexedAccessType>type).objectType, TypeFormatFlags.InElementType);
0 commit comments