Skip to content

Commit

Permalink
Fixed a JSDoc-related crash when obtaining type of a type literal typ…
Browse files Browse the repository at this point in the history
…e argument (#60358)
  • Loading branch information
Andarist authored Oct 28, 2024
1 parent 6beca69 commit cb44488
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
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,
});

0 comments on commit cb44488

Please sign in to comment.