Uh oh!
There was an error while loading. Please reload this page.
Fix #4260 : Allow trailing arguments that accept void to be omitted - #27522
Conversation
Ryan Cavanaugh (RyanCavanaugh)
commented
Oct 3, 2018
TypeScript Bot (@typescript-bot) test this |
Heya Ryan Cavanaugh (@RyanCavanaugh), I've started to run the extended test suite on this PR at 2b44a1b. You can monitor the build here. It should now contribute to this PR's status checks. |
Ryan Cavanaugh (RyanCavanaugh)
commented
Oct 3, 2018
Jack Williams (@jack-williams) FYI I expect the test run from the bot to fail so don't get worried if it comes back red |
Jack Williams (jack-williams)
commented
Oct 3, 2018
No worries! Thanks for picking it up |
Uh oh!
There was an error while loading. Please reload this page.
2b44a1b to
eae8ef1Compareeae8ef1 to
342fda9CompareJack Williams (jack-williams)
commented
Oct 16, 2018
This doesn't fix something like: declarefunctionfoo<T=void>(x: T);foo();// T = void, expected 1 arg, 0 givenwhich I actually think is one of the more useful scenarios. I disabled this behavior because otherwise it means you have to do arity checking again after instantiation which messes with overloading. I'm wondering if we could put in a special case for 1 signature? If it's seems useful enough that is. |
Ryan Cavanaugh (RyanCavanaugh)
commented
Oct 19, 2018
Jack Williams (@jack-williams) I don't find that example super compelling given that it potentially requires multiple iterations of reasoning, e.g. typeMaybeVoid=Textendsvoid ? void : object;declarefunctionfoo<T=void>(x: T,y: MaybeVoid<T>);foo(); |
Jack Williams (jack-williams)
commented
Oct 19, 2018
Ryan Cavanaugh (@RyanCavanaugh) Ye I’m inclined to agree. Thanks for merging! |
Since microsoft/TypeScript#27522 trailing void arguments may be omitted
Tags: void parameters void-typed parameters optional |
Fixes#4260