You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
In JS, return type of type reference in @type tag is ignored on function declarations. #25525
changed the title [-]No contextual type from function type behind an alias[/-][+]In JS, return type of type reference in `@type` tag is ignored on function declarations.[/+]on Jul 10, 2018
Technically, these aren't contextual types, but type annotations. That is the reason they don't work, actually: Typescript has no whole-type annotations for declarations so there was no easy analogue to translate the JSDoc to. Here's a smaller repro, which should not error, but currently does:
Activity
[-]No contextual type from function type behind an alias[/-][+]In JS, return type of type reference in `@type` tag is ignored on function declarations.[/+]sandersn commentedon Jul 10, 2018
Technically, these aren't contextual types, but type annotations. That is the reason they don't work, actually: Typescript has no whole-type annotations for declarations so there was no easy analogue to translate the JSDoc to. Here's a smaller repro, which should not error, but currently does:
Get return type from `@type` tag
Get return type from `@type` tag (#25580)