Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upHandle unary minus #1
Comments
This comment has been minimized.
This comment has been minimized.
|
One solution could be to use |
This comment has been minimized.
This comment has been minimized.
|
I just realized we can translate |
lfairy
closed this
in
c702218
Apr 3, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
lfairy commentedApr 2, 2015
-acan be translated to0.wrapping_sub(a), but that causes a type error as the0is ambiguous.One workaround is
0i32.wrapping_sub(a), wherei32is replaced with the type ofa. But that requires us to know the type of the expression in advance, which is impossible with macros as they run before type inference.I think we should simply disallow unary minus altogether.