-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Allow a type of Zero #5203
Comments
This is a duplicate of #3062 which is already on our short/medium term roadmap. With the literal types you will be able to just write |
I'm also curious where the convention to just start with |
I dont have a real example off the top of my head, except for code I was working on for a book club (Test Driven Development by Example). The book was written with Java in mind, and we decided that we should each implement it in our favorite language. |
OK, thanks.
|
I think |
I am requesting a feature. Often people want to be able to
sum()
their value types together. This is made easiest if their value types can accept an addition of 0. But the signature on such a method implies that it can accept any integer, which is false. The smallest working example would be:It would be nice if this code could instead be written as:
This more clearly communicates the intent of the method.
The text was updated successfully, but these errors were encountered: