-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Revert "Expose the useful constant values in TimeSpan" #103704
Conversation
This reverts commit 5fed175.
Note regarding the
|
1 similar comment
Note regarding the
|
Did I break something? |
@IDisposable I am temporarily reverting the change till we resolve the type of issue. I hurried merging the changes without addressing all comments. or we just implement the original approved proposal. |
No, not all reviewers agreed to have all constants as |
Tagging subscribers to this area: @dotnet/area-system-datetime |
If we want to move most (non |
Can we go exact as the approved proposal? #94545 (comment). Or you think |
I don't know of issues, I was left with the impression that avoiding potential of overflow was desired by this comment from @tannergooding... I welcome a final judgement. Of course I could build it as proposed and see anything breaks in the tests. |
Let's do that then. I'll close this PR. Are you going to submit a new PR? or I can do it if you are not interested? |
We'll submit a change in another PR. |
The main consideration from @bartonjs was that there are some constants, such as Inversely, the concern I raised is that there are scenarios this can cause problems since
|
@tannergooding let's apply the approved proposal first as the changes merged and we need to fix it before it goes out. Any other suggestion can be tracked to bring it again to the design review. @IDisposable please let me know if you'll submit a new PR or want me to do it. |
They're also expected to be used in cases where int totalSeconds = ...;
int totalDays = totalSeconds / TimeSpan.SecondsPerDay; Nope. Doesn't compile. |
Yes, which is good because it is better for code to not compile than to silently fail due to an accidental overflow. The user will get an error and they resolve the code by doing That is a stark contrast from the inverse case where When considering |
I've put together the changes as originally approved and it builds on my machine.. I'll push a PR in a second. |
New PR to drop to |
/ba-g this is straight reverted of other change. The failures are unrelated to the change. |
After the revert, we've settled on exposing everything except New PR #103993 |
Reverts #103498