-
-
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
#11105 Add syntax errors for unsigned literals > UInt128 #11130
Conversation
… get promoted to signed
cf #11105 In order to get the auto-close behavior, the commit message needs the word "fixes" or "closes" before the cross-reference. It's generally better to put that in the descriptive part of the commit message rather than the title line (but that's not a rigorous rule). Probably needs a check over from @JeffBezanson since it touches the parser, and cc @jakebolewski as a heads up for JuliaParser.jl. |
@pao Thanks for the continued advice! I actually don't even know what you mean by the auto-close behavior, or how to separate out a title line from a descriptive part of a commit message... I just do |
If you have a "reasonable" git installation, for some definition of reasonable, you will get an editor pop up if you leave off the
With the "fixes"/"closes"/"fix" bit in there, if this pull request is merged, the other issue will automatically be closed, which besides adding traceability is rather convenient. |
Hmmm.... something must be wrong with my installation then... it brings up Aquamacs, but the git commit command has already ended with an error...
|
#@test -0o0000000000000000000000000000000000000000001 == | ||
# -(0o0000000000000000000000000000000000000000001) | ||
#@test -0b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 == | ||
# -(0b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001) |
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.
Seems like just deleting these would be better, no?
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.
OK, sure, will do... thanks!
@ScottPJones this should throw a deprecation warning, not an error at this point (to follow our deprecation policy). See the other instances of throwing deprecated syntax warnings in this file. The tests can also be removed completely. |
@jakebolewski, I kind of doubt that there's much code relying on this though – having hex BigInt literals is pretty strange (which is why we're removing it), and it would never happen at runtime since it is a parse time error. |
Why not deprecate the behavior of parsing signed |
I'd be greatly in favor of that, but that probably doesn't need to be done within the same PR? |
No you are right, but if we were going to deprecate parsing |
Let's stick with one thing at a time – everyone agrees that parsing long unsigned literals as BigInts is a bad idea, so let's delete it. I for one, am not convinced yet that we want to get rid of parsing large signed literals as BigInts. |
I agree with @StefanKarpinski on not (yet) being convinced of getting rid of parsing large signed literals... I mainly brought this up because of the inconsistency and potential surprise of the unsigned to signed types... but I also understand @jakebolewski 's concern about dependencies... since there is always the option of using I'll remove the old tests, change to deprecation warnings, possibly fix up the tests I added (how do you test for a deprecation warning? I know Thanks everybody! |
Thanks @ScottPJones for the update. There has been talk of Float80 / Float128 support (linking to GNU libquadmath). See issue #757. |
#11105 Add syntax errors for unsigned literals > UInt128
Previously, these unsigned literals would get promoted from an unsigned integer to a signed type,
which could lead to errors.
It is safer to give a syntax error, while the user can still explicitly get a BigInt value using hex, octal or binary notation by doing big"0x...." instead.