-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Regression: 3.6 crashes if constructor parameters transformed #33295
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
Labels
Bug
A bug in TypeScript
Crash
For flagging bugs which are compiler or service crashes or unclean exits, rather than bad output
Domain: Transforms
Relates to the public transform API
Milestone
Comments
CC @rbuckton |
mprobst
added a commit
to mprobst/TypeScript
that referenced
this issue
Sep 9, 2019
Fixes microsoft#33295. This follows a similar pattern as in microsoft#20314 by requiring an explicit `parent` parameter. Where possible, it uses the appopriate variable at the call sites. In several locations there is no context available though (e.g. inspecting `valueDeclarations`) and we access `.parent` as the code previously did. From a cursory inspection this seems correct, these callpaths originate in phases where there must be a `parent` (i.e. in checker, binder, etc). Change-Id: I28e4726777b57237bec776e4001e9e69ac591b11
mprobst
added a commit
to mprobst/TypeScript
that referenced
this issue
Sep 9, 2019
Fixes microsoft#33295. This follows a similar pattern as in microsoft#20314 by requiring an explicit `parent` parameter. Where possible, it uses the appopriate variable at the call sites. In several locations there is no context available though (e.g. inspecting `valueDeclarations`) and we access `.parent` as the code previously did. From a cursory inspection this seems correct, these callpaths originate in phases where there must be a `parent` (i.e. in checker, binder, etc). Change-Id: I28e4726777b57237bec776e4001e9e69ac591b11
mprobst
added a commit
to mprobst/TypeScript
that referenced
this issue
Sep 9, 2019
Fixes microsoft#33295. This follows a similar pattern as in microsoft#20314 by requiring an explicit `parent` parameter. Where possible, it uses the appopriate variable at the call sites. In several locations there is no context available though (e.g. inspecting `valueDeclarations`) and we access `.parent` as the code previously did. From a cursory inspection this seems correct, these callpaths originate in phases where there must be a `parent` (i.e. in checker, binder, etc).
mprobst
added a commit
to angular/tsickle
that referenced
this issue
Sep 10, 2019
This is based on github.com/mprobst/TypeScript#v3.6.2-p1, resolved to commit 96c94d1a61cd26b2649c8cbdd0782426c32b2c27. This is a temporary workaround for microsoft/TypeScript#33295. This fixes (for the time being) #1065.
mprobst
added a commit
to angular/tsickle
that referenced
this issue
Sep 10, 2019
This is using a patched TypeScript version from github.com/mprobst/TypeScript#v3.6.2-p1, resolved to commit 96c94d1a61cd26b2649c8cbdd0782426c32b2c27. This is a temporary workaround for microsoft/TypeScript#33295. This fixes (for the time being) #1065.
mprobst
added a commit
to angular/tsickle
that referenced
this issue
Sep 10, 2019
This is using a patched TypeScript version from github.com/mprobst/TypeScript#v3.6.2-p1, resolved to commit 96c94d1a61cd26b2649c8cbdd0782426c32b2c27. This is a temporary workaround for microsoft/TypeScript#33295. This fixes (for the time being) #1065.
mprobst
added a commit
to mprobst/TypeScript
that referenced
this issue
Sep 17, 2019
Fixes microsoft#33295. This follows a similar pattern as in microsoft#20314 by requiring an explicit `parent` parameter. Where possible, it uses the appopriate variable at the call sites. In several locations there is no context available though (e.g. inspecting `valueDeclarations`) and we access `.parent` as the code previously did. From a cursory inspection this seems correct, these callpaths originate in phases where there must be a `parent` (i.e. in checker, binder, etc). Change-Id: I28e4726777b57237bec776e4001e9e69ac591b11
DanielRosenwasser
pushed a commit
that referenced
this issue
Sep 17, 2019
Fixes #33295. This follows a similar pattern as in #20314 by requiring an explicit `parent` parameter. Where possible, it uses the appopriate variable at the call sites. In several locations there is no context available though (e.g. inspecting `valueDeclarations`) and we access `.parent` as the code previously did. From a cursory inspection this seems correct, these callpaths originate in phases where there must be a `parent` (i.e. in checker, binder, etc). Change-Id: I28e4726777b57237bec776e4001e9e69ac591b11
This was referenced Oct 2, 2019
mprobst
added a commit
to angular/tsickle
that referenced
this issue
Oct 7, 2019
This is using a patched TypeScript version from github.com/mprobst/TypeScript#v3.6.2-p1, resolved to commit 96c94d1a61cd26b2649c8cbdd0782426c32b2c27. This is a temporary workaround for microsoft/TypeScript#33295. This fixes (for the time being) #1065.
mprobst
added a commit
to angular/tsickle
that referenced
this issue
Oct 16, 2019
This is using a patched TypeScript version from github.com/mprobst/TypeScript#v3.6.2-p1, resolved to commit 96c94d1a61cd26b2649c8cbdd0782426c32b2c27. This is a temporary workaround for microsoft/TypeScript#33295. This fixes (for the time being) #1065.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Bug
A bug in TypeScript
Crash
For flagging bugs which are compiler or service crashes or unclean exits, rather than bad output
Domain: Transforms
Relates to the public transform API
TypeScript Version: 3.6.2, and typescript@3.7.0-dev.20190906
Search Terms:
isParameterPropertyDeclaration
Code
Briefly, if a transformer touches the parameters of a constructor via e.g.
ts.updateParameter
, then the new node loses itsparent
pointer, which produces the following backtrace once TS runs after the transformer. (The below is 3.6.2 to make the line numbers easier for you to match up, but it also repros on the head version.)Here's an example transformer that provokes this crash. Note that it doesn't actually change anything in the AST, it just runs
ts.updateParameter
with a copy of the input array (using the...
spread) to forcets.updateParameter
to not early exit.Expected behavior:
This code succeeds under TS3.5.
Actual behavior:
This crashes in 3.6.
Playground Link:
Related Issues:
The text was updated successfully, but these errors were encountered: