Skip to content

Commit a32cbed

Browse files
Keen Yee Liaukara
authored andcommitted
fix(language-service): use empty statement as parent of type node (#36989)
In TypeScript 3.9, type nodes need to exist in the context of a statement. This commit ensures that the synthetic type node has such a parent. PR Close #36989
1 parent c42f35e commit a32cbed

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/language-service/src/typescript_symbols.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -827,7 +827,7 @@ function getTsTypeFromBuiltinType(builtinType: BuiltinType, ctx: TypeContext): t
827827
`Internal error, unhandled literal kind ${builtinType}:${BuiltinType[builtinType]}`);
828828
}
829829
const node = ts.createNode(syntaxKind);
830-
node.parent = ctx.node;
830+
node.parent = ts.createEmptyStatement();
831831
return ctx.checker.getTypeAtLocation(node);
832832
}
833833

0 commit comments

Comments
 (0)