-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: JSDocRelates to JSDoc parsing and type generationRelates to JSDoc parsing and type generation
Milestone
Description
I think that ...*?
is equivalent to the typescript type any[] | null
. However, it results in the type any[]
.
// @checkJs: true
// @allowJs: true
// @strict: true
/**
* @return {...*?}
*/
function f() {
return null // fine, but should be an error? maybe?
}
Expected behavior:
I'm not actually sure what the correct behaviour is:
- Parse error
- any[] | null
(any | null)[]
(but this would mean that the prefix type parsed after the suffix type, which is incorrect).
And I'm not sure whether the error is in the parser or in getTypeOfTypeNode
.
Also note that ...*=
doesn't parse at all, but this is less bad (I think?).
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: JSDocRelates to JSDoc parsing and type generationRelates to JSDoc parsing and type generation