eslint/doctrine

Parsing @type has optional literal is failed on demo

Closed this issue · 4 comments

For example, @type {foo=} is failed on demo page.
However, @param {foo=} is success.

Is the behavior by spec?

Thanks for your report.
Yes, this is the behavior by spec. Probably I think this is the same behavior to Google Closure Compiler, right?

@type {foo=}

Should be @type {foo|undefined} instead.

Hmm, I received an error with Closure Compiler trunk.
2013-06-24 11 12 46

Thanks, @Constellation and @tschaub !

I missed what official document was said.

herefore if the method stores the parameter's value in a class property, the type declaration of that property must include a possible value of undefined

I understand that = is accepted on only @param.