clutz icon indicating copy to clipboard operation
clutz copied to clipboard

Translate Closures ! to NonNullable<T> in clutz

Open rkirov opened this issue 6 years ago • 0 comments

In incremental mode we have to translate typedefs without seeing the original definitions.

For example:

/**
 * @typedef {string|null}
 */
var StringOrNull;

is translated to:

  type StringOrNull = string | null; 

However, in closure land when one writes @type {!StringOrNull} the correct translation is not : StringOrNull but rather NonNullable<StringOrNull>.

Thankfully, classes and interfaces are non-nullable by default in TS, so for them this is not an issue.

rkirov avatar Mar 27 '18 19:03 rkirov