TypeScript
TypeScript copied to clipboard
jsdoc @type does not resolve a type
🔎 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
Can you post the API code you're using?