Skip to content

Fixed a JSDoc-related crash when obtaining type of a type literal type argument #60358

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/compiler/checker.ts
Original file line number Diff line number Diff line change
@@ -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 {
25 changes: 25 additions & 0 deletions tests/cases/fourslash/completionsJSDocNoCrash3.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/// <reference path='fourslash.ts' />

// @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,
});