do not consider associativity for unary minus for fixity resolution
- currently an expression "1 + - 1" is rejected, because "1 + (-1)" looks as being bracketed to the right, whereas + and - are left associative. However, no other bracketing is possible, so "1 + - 1" is unambiguous and should not be subject to further fixity resolution.
- if an infix expressions starts with an unary minus, the associativity should not matter for the unary minus. Why should "- 1 ## 1" be rejected for a right- or non-assoc operator "##"? Precedence alone is sufficient to decide between "(- 1) ## 1" and "- (1 ## 1)". The latter choice is taken for a higher precedence of the infix operator and the former choice should always be taken
for an equal or lower precedence as is done for "- 1 + 1", but without looking at associativity!
I'll attach an alternative fixity resolution in the spirit of
Trac metadata
Trac field | Value |
---|---|
Version | 6.12.3 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |