Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Translate Closures ! to NonNullable<T> in clutz #723

Open
rkirov opened this issue Mar 27, 2018 · 0 comments
Open

Translate Closures ! to NonNullable<T> in clutz #723

rkirov opened this issue Mar 27, 2018 · 0 comments

Comments

@rkirov
Copy link
Contributor

rkirov commented Mar 27, 2018

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant