TypeScript icon indicating copy to clipboard operation
TypeScript copied to clipboard

jsdoc @type does not resolve a type

Open marklundin opened this issue 1 year ago • 1 comments

🔎 Search Terms

jsdoc @type object literal

🕗 Version & Regression Information

  • This is the behavior in every version I tried

⏯ Playground Link

No response

💻 Code

/**
  * @attribute
  * @type {{ a: string, b: number }} 
  */
var9

🙁 Actual behavior

I have checkJS enabled

When attempting to get the type for a node with an object literal using typeChcker.getTypeAtLocation, it returns an error type for the given node.

🙂 Expected behavior

When the @type tag refers to a @typedef eg /** @typedef {{ x: number, y: number }} MyType */ it resolves the type correctly. I would expect the inline object literal type notation to behave in the same way as the type def

Additional information about the issue

No response

marklundin avatar Apr 29 '24 15:04 marklundin

Can you post the API code you're using?

RyanCavanaugh avatar May 02 '24 22:05 RyanCavanaugh