-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Actual signature help trigger filtering #25422
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
Conversation
033aab8
to
9481faa
Compare
@@ -1515,7 +1515,9 @@ Actual: ${stringify(fullActual)}`); | |||
"argumentCount", | |||
]; | |||
for (const key in options) { | |||
ts.Debug.assert(ts.contains(allKeys, key)); | |||
if (!ts.contains(allKeys, key)) { | |||
ts.Debug.fail("Unexpected key " + key); |
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.
You should return ts.Debug.fail("Unexpected key " + key);
, probably.
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.
I usually only do that when the compiler needs to know more about reachability, but I don't think it's necessary here unless I'm missing something.
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.
We were talking about making it a lint rule a few weeks ago, that way the reachability graph is more complete and may expose more logic bugs (eg, can a following if statement never actually occur because of the implied throw here).
🎉 |
Fixes #25393.