-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Declaration emit should retain (instead of elide) unresolved computed names #58428
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
Declaration emit should retain (instead of elide) unresolved computed names #58428
Conversation
This seems fine but I'm still not clear how this totally fixes the linked issue; shouldn't there be an error somewhere about this? |
There is... if the file is typechecked. I believe this isn't an isolated declarations error since it's the expectation that usually people won't write nonfunctional/conflicting computed names, and it'll just copy the input nodes to the output, which this PR adjusts our node builder and declaration emitter to do. |
Ah. Right, we don't include check errors in this output (unless we happen on them) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But we probably need to warn about that somewhere... But it's not like transpileModule is much different. And a syntactic transpiler will probably just copy too.
Historically, if a
[name]: whatever
didn't resolve, it was elided in a declaration file, even when you wrote it explicitly in a type. This PR changes that behavior to instead copy the name into the output even when it doesn't resolve. Since the input has a checker error in this case, our declaration output here is flexible, and this makes us align with expectation underisolatedDeclarations
.Fixes #58423