Skip to content
This repository was archived by the owner on Sep 1, 2026. It is now read-only.

Support alternate spellings in JSDoc type annotations - #3402

Merged
Anders Hejlsberg (ahejlsberg) merged 3 commits into
mainfrom
jsdoc-special-types
Apr 16, 2026
Merged

Anders Hejlsberg (ahejlsberg) merged 3 commits into
mainfrom
jsdoc-special-types

Conversation

@ahejlsberg

Copy link
Copy Markdown
Member

This PR ports getIntendedTypeFromJSDocTypeReference to align our JSDoc support more closely with Strada.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR updates the checker to recognize certain JSDoc type-reference “alternate spellings” (e.g. String → string, Object<K,V> → Record<K,V>, function → Function) and refreshes the repository’s baselines accordingly.

Changes:

  • Add getIntendedTypeFromJSDocTypeReference and integrate it into type-reference resolution for JSDoc contexts.
  • Adjust checkNoTypeArguments error reporting when a symbol isn’t available.
  • Update a large set of conformance, compiler, and fourslash baselines to match the new JSDoc type-resolution behavior.

Reviewed changes

Copilot reviewed 148 out of 148 changed files in this pull request and generated no comments.

Show a summary per file
File Description
internal/checker/checker.go Adds JSDoc intended-type mapping for type references and adjusts type-arg error reporting.
testdata/baselines/reference/submoduleAccepted/conformance/asyncArrowFunction_allowJs.types.diff Baseline update reflecting function → Function and related type output shifts.
testdata/baselines/reference/submoduleAccepted/conformance/asyncArrowFunction_allowJs.errors.txt.diff Baseline update reflecting changed diagnostics after intended-type mapping.
testdata/baselines/reference/submodule/conformance/typedefTagWrapping.errors.txt.diff Baseline update reflecting diagnostics changes for JSDoc type references.
testdata/baselines/reference/submodule/conformance/typedefTagWrapping.errors.txt Baseline update reflecting diagnostics changes for JSDoc type references.
testdata/baselines/reference/submodule/conformance/typedefTagExtraneousProperty.types.diff Baseline update reflecting Object<K,V> → Record<K,V> and property typing changes.
testdata/baselines/reference/submodule/conformance/typedefTagExtraneousProperty.types Baseline update reflecting Object<K,V> → Record<K,V> and property typing changes.
testdata/baselines/reference/submodule/conformance/typedefTagExtraneousProperty.errors.txt.diff Removes/updates obsolete baseline diff for errors output.
testdata/baselines/reference/submodule/conformance/typedefTagExtraneousProperty.errors.txt Removes/updates obsolete baseline errors output.
testdata/baselines/reference/submodule/conformance/thisPropertyAssignmentInherited.types.diff Removes/updates obsolete baseline diff for types output.
testdata/baselines/reference/submodule/conformance/thisPropertyAssignmentInherited.types Baseline update reflecting String wrapper handling in JSDoc.
testdata/baselines/reference/submodule/conformance/thisPropertyAssignmentInherited.js.diff Baseline update reflecting String wrapper handling in generated declarations.
testdata/baselines/reference/submodule/conformance/thisPropertyAssignmentInherited.js Baseline update reflecting String wrapper handling in generated declarations.
testdata/baselines/reference/submodule/conformance/jsdocVariadicType.types.diff Baseline update reflecting function → Function.
testdata/baselines/reference/submodule/conformance/jsdocVariadicType.types Baseline update reflecting function → Function.
testdata/baselines/reference/submodule/conformance/jsdocVariadicType.errors.txt.diff Baseline update reflecting changed diagnostics after intended-type mapping.
testdata/baselines/reference/submodule/conformance/jsdocVariadicType.errors.txt Baseline update reflecting changed diagnostics after intended-type mapping.
testdata/baselines/reference/submodule/conformance/jsdocTypeTagRequiredParameters.types.diff Baseline update reflecting function → Function.
testdata/baselines/reference/submodule/conformance/jsdocTypeTagRequiredParameters.types Baseline update reflecting function → Function.
testdata/baselines/reference/submodule/conformance/jsdocTypeTagRequiredParameters.errors.txt.diff Baseline update reflecting changed diagnostics after intended-type mapping.
testdata/baselines/reference/submodule/conformance/jsdocTypeTagRequiredParameters.errors.txt Baseline update reflecting changed diagnostics after intended-type mapping.
testdata/baselines/reference/submodule/conformance/jsdocTypeTagParameterType.types.diff Baseline update reflecting function → Function.
testdata/baselines/reference/submodule/conformance/jsdocTypeTagParameterType.types Baseline update reflecting function → Function.
testdata/baselines/reference/submodule/conformance/jsdocTypeTagParameterType.errors.txt.diff Baseline update reflecting changed diagnostics after intended-type mapping.
testdata/baselines/reference/submodule/conformance/jsdocTypeTagParameterType.errors.txt Baseline update reflecting changed diagnostics after intended-type mapping.
testdata/baselines/reference/submodule/conformance/jsdocTypeTag.types.diff Removes/updates obsolete baseline diff for types output.
testdata/baselines/reference/submodule/conformance/jsdocTypeTag.types Baseline update reflecting wrapper types (String, Number, etc.) mapping to primitives.
testdata/baselines/reference/submodule/conformance/jsdocTypeTag.errors.txt.diff Removes/updates obsolete baseline diff for errors output.
testdata/baselines/reference/submodule/conformance/jsdocTypeTag.errors.txt Baseline update reflecting reduced/changed diagnostics after mapping.
testdata/baselines/reference/submodule/conformance/jsdocThisType.types.diff Baseline update reflecting function → Function.
testdata/baselines/reference/submodule/conformance/jsdocThisType.types Baseline update reflecting function → Function.
testdata/baselines/reference/submodule/conformance/jsdocThisType.errors.txt.diff Baseline update reflecting changed diagnostics after intended-type mapping.
testdata/baselines/reference/submodule/conformance/jsdocThisType.errors.txt Baseline update reflecting changed diagnostics after intended-type mapping.
testdata/baselines/reference/submodule/conformance/jsdocTemplateTag5.errors.txt.diff Baseline update reflecting Object<K,V> → Record<K,V> behavior changes.
testdata/baselines/reference/submodule/conformance/jsdocTemplateTag5.errors.txt Baseline update reflecting Object<K,V> → Record<K,V> behavior changes.
testdata/baselines/reference/submodule/conformance/jsdocTemplateTag4.errors.txt.diff Baseline update reflecting Object<K,V> → Record<K,V> behavior changes.
testdata/baselines/reference/submodule/conformance/jsdocTemplateTag4.errors.txt Baseline update reflecting Object<K,V> → Record<K,V> behavior changes.
testdata/baselines/reference/submodule/conformance/jsdocTemplateTag.types.diff Baseline update reflecting Function and Object mapping changes.
testdata/baselines/reference/submodule/conformance/jsdocTemplateTag.types Baseline update reflecting Function and Object mapping changes.
testdata/baselines/reference/submodule/conformance/jsdocTemplateTag.errors.txt.diff Baseline update reflecting changed diagnostics after intended-type mapping.
testdata/baselines/reference/submodule/conformance/jsdocTemplateTag.errors.txt Baseline update reflecting changed diagnostics after intended-type mapping.
testdata/baselines/reference/submodule/conformance/jsdocParseStarEquals.types.diff Baseline update reflecting function → Function.
testdata/baselines/reference/submodule/conformance/jsdocParseStarEquals.types Baseline update reflecting function → Function.
testdata/baselines/reference/submodule/conformance/jsdocParseStarEquals.errors.txt.diff Baseline update reflecting changed diagnostics after intended-type mapping.
testdata/baselines/reference/submodule/conformance/jsdocParseStarEquals.errors.txt Baseline update reflecting changed diagnostics after intended-type mapping.
testdata/baselines/reference/submodule/conformance/jsdocParseParenthesizedJSDocParameter.types.diff Baseline update reflecting function → Function.
testdata/baselines/reference/submodule/conformance/jsdocParseParenthesizedJSDocParameter.types Baseline update reflecting function → Function.
testdata/baselines/reference/submodule/conformance/jsdocParseParenthesizedJSDocParameter.errors.txt.diff Baseline update reflecting changed diagnostics after intended-type mapping.
testdata/baselines/reference/submodule/conformance/jsdocParseParenthesizedJSDocParameter.errors.txt Baseline update reflecting changed diagnostics after intended-type mapping.
testdata/baselines/reference/submodule/conformance/jsdocParseHigherOrderFunction.types.diff Baseline update reflecting function → Function.
testdata/baselines/reference/submodule/conformance/jsdocParseHigherOrderFunction.types Baseline update reflecting function → Function.
testdata/baselines/reference/submodule/conformance/jsdocParseHigherOrderFunction.errors.txt.diff Baseline update reflecting changed diagnostics after intended-type mapping.
testdata/baselines/reference/submodule/conformance/jsdocParseHigherOrderFunction.errors.txt Baseline update reflecting changed diagnostics after intended-type mapping.
testdata/baselines/reference/submodule/conformance/jsdocParseDotDotDotInJSDocFunction.types.diff Baseline update reflecting function → Function.
testdata/baselines/reference/submodule/conformance/jsdocParseDotDotDotInJSDocFunction.types Baseline update reflecting function → Function.
testdata/baselines/reference/submodule/conformance/jsdocParseDotDotDotInJSDocFunction.errors.txt.diff Baseline update reflecting changed diagnostics after intended-type mapping.
testdata/baselines/reference/submodule/conformance/jsdocParseDotDotDotInJSDocFunction.errors.txt Baseline update reflecting changed diagnostics after intended-type mapping.
testdata/baselines/reference/submodule/conformance/jsdocIndexSignature.types.diff Baseline update reflecting Object<K,V> → Record<K,V>.
testdata/baselines/reference/submodule/conformance/jsdocIndexSignature.types Baseline update reflecting Object<K,V> → Record<K,V>.
testdata/baselines/reference/submodule/conformance/jsdocIndexSignature.errors.txt.diff Removes/updates obsolete baseline diff for errors output.
testdata/baselines/reference/submodule/conformance/jsdocIndexSignature.errors.txt Baseline update restoring expected index-signature assignability error.
testdata/baselines/reference/submodule/conformance/jsdocFunction_missingReturn.errors.txt.diff Baseline update reflecting changed diagnostics after intended-type mapping.
testdata/baselines/reference/submodule/conformance/jsdocFunction_missingReturn.errors.txt Baseline update reflecting changed diagnostics after intended-type mapping.
testdata/baselines/reference/submodule/conformance/jsdocFunctionType.types.diff Baseline update reflecting function → Function.
testdata/baselines/reference/submodule/conformance/jsdocFunctionType.types Baseline update reflecting function → Function.
testdata/baselines/reference/submodule/conformance/jsdocFunctionType.errors.txt.diff Baseline update reflecting changed diagnostics after intended-type mapping.
testdata/baselines/reference/submodule/conformance/jsdocFunctionType.errors.txt Baseline update reflecting changed diagnostics after intended-type mapping.
testdata/baselines/reference/submodule/conformance/jsDeclarationsTypedefPropertyAndExportAssignment.types.diff Baseline update reflecting Object<K,V> → Record<K,V>.
testdata/baselines/reference/submodule/conformance/jsDeclarationsTypedefPropertyAndExportAssignment.types Baseline update reflecting Object<K,V> → Record<K,V>.
testdata/baselines/reference/submodule/conformance/jsDeclarationsTypedefPropertyAndExportAssignment.js.diff Baseline update reflecting Record in emitted declarations.
testdata/baselines/reference/submodule/conformance/jsDeclarationsTypedefPropertyAndExportAssignment.js Baseline update reflecting Record in emitted declarations.
testdata/baselines/reference/submodule/conformance/jsDeclarationsTypedefPropertyAndExportAssignment.errors.txt.diff Removes/updates obsolete baseline diff for errors output.
testdata/baselines/reference/submodule/conformance/jsDeclarationsTypedefPropertyAndExportAssignment.errors.txt Removes/updates obsolete baseline errors output.
testdata/baselines/reference/submodule/conformance/jsDeclarationsReusesExistingNodesMappingJSDocTypes.types.diff Baseline update reflecting function → Function and Record mapping.
testdata/baselines/reference/submodule/conformance/jsDeclarationsReusesExistingNodesMappingJSDocTypes.types Baseline update reflecting function → Function and Record mapping.
testdata/baselines/reference/submodule/conformance/jsDeclarationsReusesExistingNodesMappingJSDocTypes.errors.txt.diff Baseline update reflecting changed diagnostics after intended-type mapping.
testdata/baselines/reference/submodule/conformance/jsDeclarationsReusesExistingNodesMappingJSDocTypes.errors.txt Baseline update reflecting changed diagnostics after intended-type mapping.
testdata/baselines/reference/submodule/conformance/jsDeclarationsRestArgsWithThisTypeInJSDocFunction(target=es2015).types.diff Baseline update reflecting function → Function.
testdata/baselines/reference/submodule/conformance/jsDeclarationsRestArgsWithThisTypeInJSDocFunction(target=es2015).types Baseline update reflecting function → Function.
testdata/baselines/reference/submodule/conformance/jsDeclarationsRestArgsWithThisTypeInJSDocFunction(target=es2015).errors.txt.diff Baseline update reflecting changed diagnostics after intended-type mapping.
testdata/baselines/reference/submodule/conformance/jsDeclarationsRestArgsWithThisTypeInJSDocFunction(target=es2015).errors.txt Baseline update reflecting changed diagnostics after intended-type mapping.
testdata/baselines/reference/submodule/conformance/jsDeclarationsMissingTypeParameters(target=es2015).types.diff Baseline update reflecting function → Function.
testdata/baselines/reference/submodule/conformance/jsDeclarationsMissingTypeParameters(target=es2015).types Baseline update reflecting function → Function.
testdata/baselines/reference/submodule/conformance/jsDeclarationsJSDocRedirectedLookups.types.diff Baseline update reflecting primitive-wrapper mapping and Object<K,V> → Record<K,V>.
testdata/baselines/reference/submodule/conformance/jsDeclarationsJSDocRedirectedLookups.types Baseline update reflecting primitive-wrapper mapping and Object<K,V> → Record<K,V>.
testdata/baselines/reference/submodule/conformance/jsDeclarationsJSDocRedirectedLookups.errors.txt.diff Baseline update reflecting reduced lookup-failure diagnostics.
testdata/baselines/reference/submodule/conformance/jsDeclarationsJSDocRedirectedLookups.errors.txt Baseline update reflecting reduced lookup-failure diagnostics.
testdata/baselines/reference/submodule/conformance/jsDeclarationsImportAliasExposedWithinNamespaceCjs.types.diff Baseline update reflecting Record<string, any> mapping.
testdata/baselines/reference/submodule/conformance/jsDeclarationsImportAliasExposedWithinNamespaceCjs.types Baseline update reflecting Record<string, any> mapping.
testdata/baselines/reference/submodule/conformance/jsDeclarationsImportAliasExposedWithinNamespaceCjs.js.diff Baseline update reflecting Record in emitted declarations.
testdata/baselines/reference/submodule/conformance/jsDeclarationsImportAliasExposedWithinNamespaceCjs.js Baseline update reflecting Record in emitted declarations.
testdata/baselines/reference/submodule/conformance/jsDeclarationsImportAliasExposedWithinNamespaceCjs.errors.txt.diff Baseline update reflecting reduced Object-generic diagnostics.
testdata/baselines/reference/submodule/conformance/jsDeclarationsImportAliasExposedWithinNamespaceCjs.errors.txt Baseline update reflecting reduced Object-generic diagnostics.
testdata/baselines/reference/submodule/conformance/jsDeclarationsImportAliasExposedWithinNamespace.types.diff Baseline update reflecting Record<string, any> mapping.
testdata/baselines/reference/submodule/conformance/jsDeclarationsImportAliasExposedWithinNamespace.types Baseline update reflecting Record<string, any> mapping.
testdata/baselines/reference/submodule/conformance/jsDeclarationsImportAliasExposedWithinNamespace.errors.txt.diff Baseline update reflecting reduced Object-generic diagnostics.
testdata/baselines/reference/submodule/conformance/jsDeclarationsImportAliasExposedWithinNamespace.errors.txt Baseline update reflecting reduced Object-generic diagnostics.
testdata/baselines/reference/submodule/conformance/checkJsdocTypeTagOnObjectProperty2.types.diff Baseline update reflecting function → Function.
testdata/baselines/reference/submodule/conformance/checkJsdocTypeTagOnObjectProperty2.types Baseline update reflecting function → Function.
testdata/baselines/reference/submodule/conformance/checkJsdocTypeTagOnObjectProperty2.errors.txt.diff Baseline update reflecting changed diagnostics after intended-type mapping.
testdata/baselines/reference/submodule/conformance/checkJsdocTypeTagOnObjectProperty2.errors.txt Baseline update reflecting changed diagnostics after intended-type mapping.
testdata/baselines/reference/submodule/conformance/checkJsdocTypeTagOnObjectProperty1.types.diff Baseline update reflecting Function mapping in object property types.
testdata/baselines/reference/submodule/conformance/checkJsdocTypeTagOnObjectProperty1.types Baseline update reflecting Function mapping in object property types.
testdata/baselines/reference/submodule/conformance/checkJsdocTypeTagOnObjectProperty1.errors.txt.diff Baseline update reflecting changed diagnostics after intended-type mapping.
testdata/baselines/reference/submodule/conformance/checkJsdocTypeTagOnObjectProperty1.errors.txt Baseline update reflecting changed diagnostics after intended-type mapping.
testdata/baselines/reference/submodule/conformance/checkJsdocTypeTag8.types.diff Removes/updates obsolete baseline diff for types output.
testdata/baselines/reference/submodule/conformance/checkJsdocTypeTag8.types Baseline update reflecting `Number
testdata/baselines/reference/submodule/conformance/checkJsdocTypeTag8.errors.txt.diff Removes/updates obsolete baseline diff for errors output.
testdata/baselines/reference/submodule/conformance/checkJsdocTypeTag8.errors.txt Removes/updates obsolete baseline errors output.
testdata/baselines/reference/submodule/conformance/checkJsdocTypeTag2.types.diff Baseline update reflecting wrapper-type mapping and function → Function.
testdata/baselines/reference/submodule/conformance/checkJsdocTypeTag2.types Baseline update reflecting wrapper-type mapping and function → Function.
testdata/baselines/reference/submodule/conformance/checkJsdocTypeTag2.errors.txt.diff Baseline update reflecting changed diagnostics after intended-type mapping.
testdata/baselines/reference/submodule/conformance/checkJsdocTypeTag2.errors.txt Baseline update reflecting changed diagnostics after intended-type mapping.
testdata/baselines/reference/submodule/conformance/checkJsdocTypeTag1.types.diff Baseline update reflecting wrapper-type mapping and function → Function.
testdata/baselines/reference/submodule/conformance/checkJsdocTypeTag1.types Baseline update reflecting wrapper-type mapping and function → Function.
testdata/baselines/reference/submodule/conformance/checkJsdocTypeTag1.errors.txt.diff Baseline update reflecting changed diagnostics after intended-type mapping.
testdata/baselines/reference/submodule/conformance/checkJsdocTypeTag1.errors.txt Baseline update reflecting changed diagnostics after intended-type mapping.
testdata/baselines/reference/submodule/conformance/checkJsdocSatisfiesTag8.types.diff Removes/updates obsolete baseline diff for types output.
testdata/baselines/reference/submodule/conformance/checkJsdocSatisfiesTag8.types Baseline update reflecting restored @satisfies typing behavior.
testdata/baselines/reference/submodule/conformance/checkJsdocSatisfiesTag8.errors.txt.diff Removes/updates obsolete baseline diff for errors output.
testdata/baselines/reference/submodule/conformance/checkJsdocSatisfiesTag8.errors.txt Baseline update reflecting restored @satisfies error location and message.
testdata/baselines/reference/submodule/conformance/checkJsdocSatisfiesTag2.types.diff Removes/updates obsolete baseline diff for types output.
testdata/baselines/reference/submodule/conformance/checkJsdocSatisfiesTag2.types Baseline update reflecting restored @satisfies typing behavior.
testdata/baselines/reference/submodule/conformance/checkJsdocSatisfiesTag2.errors.txt.diff Removes/updates obsolete baseline diff for errors output.
testdata/baselines/reference/submodule/conformance/checkJsdocSatisfiesTag2.errors.txt Removes/updates obsolete baseline errors output.
testdata/baselines/reference/submodule/conformance/asyncArrowFunction_allowJs.types Baseline update reflecting function → Function.
testdata/baselines/reference/submodule/conformance/asyncArrowFunction_allowJs.errors.txt Baseline update reflecting changed diagnostics after intended-type mapping.
testdata/baselines/reference/submodule/compiler/returnConditionalExpressionJSDocCast.types.diff Removes/updates obsolete baseline diff for types output.
testdata/baselines/reference/submodule/compiler/returnConditionalExpressionJSDocCast.types Baseline update reflecting String → string in JSDoc cast results.
testdata/baselines/reference/submodule/compiler/jsdocTypeNongenericInstantiationAttempt.types.diff Baseline update reflecting wrapper-type mapping in generics.
testdata/baselines/reference/submodule/compiler/jsdocTypeNongenericInstantiationAttempt.types Baseline update reflecting wrapper-type mapping in generics.
testdata/baselines/reference/submodule/compiler/jsdocTypeNongenericInstantiationAttempt.errors.txt.diff Baseline update reflecting changed diagnostics after intended-type mapping.
testdata/baselines/reference/submodule/compiler/jsdocTypeNongenericInstantiationAttempt.errors.txt Baseline update reflecting changed diagnostics after intended-type mapping.
testdata/baselines/reference/submodule/compiler/jsdocParameterParsingInfiniteLoop.types.diff Baseline update reflecting function → Function.
testdata/baselines/reference/submodule/compiler/jsdocParameterParsingInfiniteLoop.types Baseline update reflecting function → Function.
testdata/baselines/reference/submodule/compiler/jsdocParameterParsingInfiniteLoop.errors.txt.diff Baseline update reflecting changed diagnostics after intended-type mapping.
testdata/baselines/reference/submodule/compiler/jsdocParameterParsingInfiniteLoop.errors.txt Baseline update reflecting changed diagnostics after intended-type mapping.
testdata/baselines/reference/submodule/compiler/jsdocArrayObjectPromiseNoImplicitAny.types.diff Baseline update reflecting Object<K,V> → Record<K,V>.
testdata/baselines/reference/submodule/compiler/jsdocArrayObjectPromiseNoImplicitAny.types Baseline update reflecting Object<K,V> → Record<K,V>.
testdata/baselines/reference/submodule/compiler/jsdocArrayObjectPromiseNoImplicitAny.errors.txt.diff Removes/updates obsolete baseline diff for errors output.
testdata/baselines/reference/submodule/compiler/jsdocArrayObjectPromiseNoImplicitAny.errors.txt Baseline update reflecting reduced Object-generic diagnostics.
testdata/baselines/reference/submodule/compiler/jsdocArrayObjectPromiseImplicitAny.types.diff Baseline update reflecting Object<K,V> → Record<K,V> and Object handling.
testdata/baselines/reference/submodule/compiler/jsdocArrayObjectPromiseImplicitAny.types Baseline update reflecting Object<K,V> → Record<K,V> and Object handling.
testdata/baselines/reference/submodule/compiler/jsdocArrayObjectPromiseImplicitAny.errors.txt.diff Removes/updates obsolete baseline diff for errors output.
testdata/baselines/reference/submodule/compiler/jsdocArrayObjectPromiseImplicitAny.errors.txt Removes/updates obsolete baseline errors output.
testdata/baselines/reference/fourslash/signatureHelp/jsDocFunctionSignatures5.baseline Baseline update reflecting primitive type display (String → string) in signature help.
testdata/baselines/reference/fourslash/quickInfo/jsDocTypeTagQuickInfo2.baseline Baseline update reflecting function → Function in quick info.
testdata/baselines/reference/fourslash/quickInfo/jsDocTypeTagQuickInfo1.baseline Baseline update reflecting wrapper types mapping to primitives in quick info.
Comments suppressed due to low confidence (3)

internal/checker/checker.go:1

  • The comment says the resolved symbol should be cached because it’s needed later in checkTypeReferenceNode, but this refactor no longer calls getSymbolFromTypeReference(node) for the const and getIntendedTypeFromJSDocTypeReference branches. That likely leaves links.resolvedSymbol unset/cold for those cases and can cause later checks to re-resolve (or behave differently) despite links.resolvedType being set. Consider always resolving/caching the symbol up-front (even if you don’t use it for the type) or explicitly setting links.resolvedSymbol when returning an intended JSDoc type.
    internal/checker/checker.go:1
  • checkNoTypeArguments now assumes node is a TypeReferenceNode whenever symbol == nil and unconditionally calls node.AsTypeReferenceNode(). If checkNoTypeArguments is invoked elsewhere with a different node kind (which is plausible given it’s a general-purpose helper), this will panic. A safer approach is to guard with ast.IsTypeReferenceNode(node) (or similar) and fall back to a more general name formatter when it’s not a type reference.
    internal/checker/checker.go:1
  • Mapping lowercase function to globalFunctionType can unintentionally erase signature information in JSDoc annotations that use function(...)-style syntax (which is commonly meant to express a callable/construct signature, not the global Function object type). This shows up as downstream type degradation (e.g., values becoming Function instead of a specific call/construct signature) and can introduce new diagnostics like “Type 'Function' has no construct signatures.” If the goal is only to support {function} as an alias for Function, consider restricting this mapping to the no-parameters form (or dropping the lowercase function mapping until the JSDoc function(...) form is parsed/represented as a dedicated function-type node).

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
1 pipeline(s) were filtered out due to trigger conditions.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants