-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
fix undef var in conversion in rounding modes in MPFR #31258
Conversation
Worth a test? |
(the change was only in 1.1, so doesn't need to be backported before that) |
I'm also not sure how one could test this. I guess use |
Yes, something like this: bad_rounding_mode = reinterpret(Base.MPFR.MPFRRoundingMode, Int32(42))
@test_throws ArgumentError convert(RoundingMode, bad_rounding_mode) Doing the |
It seems really weird to have to do something like reinterpreting to an invalid enum to test something. In fact, it can be determined deterministically that the error path cannot happen. So I can change it to just |
Yes, I was wondering the same. It's more an assertion then an |
Since this is unreachable code but more correct unreachable code, I'll just merge it. |
(cherry picked from commit c214427)
No description provided.