diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 2d373bc6ece4c..88c71bbfdf088 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -19362,7 +19362,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { if (!links.resolvedType) { // Deferred resolution of members is handled by resolveObjectTypeMembers const aliasSymbol = getAliasSymbolForTypeNode(node); - if (getMembersOfSymbol(node.symbol).size === 0 && !aliasSymbol) { + if (!node.symbol || getMembersOfSymbol(node.symbol).size === 0 && !aliasSymbol) { links.resolvedType = emptyTypeLiteralType; } else { diff --git a/tests/cases/fourslash/completionsJSDocNoCrash3.ts b/tests/cases/fourslash/completionsJSDocNoCrash3.ts new file mode 100644 index 0000000000000..f952b30422468 --- /dev/null +++ b/tests/cases/fourslash/completionsJSDocNoCrash3.ts @@ -0,0 +1,25 @@ +/// + +// @strict: true + +// @filename: index.ts +//// class MssqlClient { +//// /** +//// * +//// * @param {Object} - args +//// * @param {String} - args.parentTable +//// * @returns {Promise<{upStatement/**/, downStatement}>} +//// */ +//// async relationCreate(args) {} +//// } +//// +//// export default MssqlClient; + +verify.completions({ + marker: "", + exact: [{ + name: "readonly", + sortText: completion.SortText.GlobalsOrKeywords, + }], + isNewIdentifierLocation: true, +});