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
The type annotation on x should be preserved and emitted exactly as written. Specifically, the declaration file emitter should only emit from Type objects when dealing with inferred types.
The current scheme of always emitting from Type objects actually leads to errors.
It does look like we need some tests for this, I don't see any .d.ts related tests in #1033. Need to double check whether these rules are codified in the latest spec yet.
@DickvdBrink@danquirk , this is not completely fixed. We want to change this to emit type annotation as user wrote and I am working on that. I have the change but I am still adding tests to cover different scenarios. This should be in by mid week.
If a type annotation is present it should be emitted exactly as written when generating a .d.ts file. For example:
The .d.ts file for the above is currently emitted as:
The type annotation on
x
should be preserved and emitted exactly as written. Specifically, the declaration file emitter should only emit from Type objects when dealing with inferred types.The current scheme of always emitting from Type objects actually leads to errors.
Here, an error occurs when the emitter tries to emit
Window | string
in place of theW
type annotation.The text was updated successfully, but these errors were encountered: