Actions
Bug #19583
closedUnary minus inconsistency when used with variables and literals
Bug #19583:
Unary minus inconsistency when used with variables and literals
Description
This feels a bit inconsistent and I could not find an explanation.
This is fine and - has higher precedence than .
But this is not working, won't even compile (requires parens):
I presume that in the first example there is no unary minus operation, just negative literal.
Ok, according to this - my assumption is correct. The question is - why?
Updated by hurricup (Alexandr Evstigneev) over 3 years ago
- Description updated (diff)
Updated by Hanmac (Hans Mackowiak) over 3 years ago
Updated by byroot (Jean Boussier) over 3 years ago
- Status changed from Open to Closed
Yeah, I don't think this is a bug, and even if we decided another precedence would have been better, changing it would break way too much code.
Actions