Salsa does not support @type annotation in object member #13306
Labels
Bug
A bug in TypeScript
Domain: JSDoc
Relates to JSDoc parsing and type generation
Fixed
A PR has been merged for this issue
Milestone
TypeScript Version: 2.2.0-dev.20170102 (--strictNullChecks)
Code
Expected behavior:
Type of
obj.foo
to bestring | undefined
Current workaround is something like:
A
@type
annotation could also be placed in theobj
itself, but that gets unwieldy when the object itself is large.Putting all these things in an object like this is arguably an anti-pattern (should be a module or class instead), but it's a start when adapting decade-old legacy code :)
Possibly related to #5158 as supporting its "assertion-y" use would make for a simpler workaround that doesn't require an IIFE.
The text was updated successfully, but these errors were encountered: