Skip to content

Commit 76fc607

Browse files
committed
1 parent e3ddfb9 commit 76fc607

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/compiler/checker.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3937,7 +3937,12 @@ namespace ts {
39373937
writePunctuation(writer, SyntaxKind.CloseBracketToken);
39383938
writePunctuation(writer, SyntaxKind.ColonToken);
39393939
writeSpace(writer);
3940-
buildTypeDisplay(info.type, writer, enclosingDeclaration, globalFlags, symbolStack);
3940+
if (info.type) {
3941+
buildTypeDisplay(info.type, writer, enclosingDeclaration, globalFlags, symbolStack);
3942+
}
3943+
else {
3944+
writeKeyword(writer, SyntaxKind.AnyKeyword);
3945+
}
39413946
writePunctuation(writer, SyntaxKind.SemicolonToken);
39423947
writer.writeLine();
39433948
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/// <reference path="fourslash.ts" />
2+
3+
// @noImplicitAny: true
4+
//// function f(y, z = { p: y[
5+
6+
verify.getAndApplyCodeFix();

0 commit comments

Comments
 (0)