Skip to content

Fix printing and emit for definite assignment assertions #35095

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 21, 2019

Conversation

weswigham
Copy link
Member

Fixes #35093

We use definite assignment assertions in our own codebase, so the referenced bug is actually blocking me doing source to source transforms on our real codebase.

@@ -3807,7 +3807,7 @@ namespace ts {
}

// Type annotations are TypeScript syntax.
if (node.type) {
if (node.type || node.exclamationToken) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this change related to the emitter?
If so, you probably also want to make the same change in computePropertyDeclaration (see #35097 which I erroneously opened)

@weswigham weswigham merged commit 614a07c into microsoft:master Nov 21, 2019
@weswigham weswigham deleted the fix-assignment-assertion-emit branch November 21, 2019 19:21
jablko pushed a commit to jablko/TypeScript that referenced this pull request Nov 21, 2019
…5095)

* Fix printing and emit for definite assignment assertions

* Make factories that handle definite assertions internal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Definite assignment assertions are not emitted by printer
3 participants