Skip to content

Fix #727 (#if: two unary operators in a row silently evaluate to false) - #730

Merged
danmar merged 1 commit into
masterfrom
fix-727
Nov 7, 2026
Merged

danmar merged 1 commit into
masterfrom
fix-727

Conversation

@danmar

@danmar danmar commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator

Unary operators were folded from left to right in one pass, so in "!-0" the ! was skipped because its operand was not folded yet. Fold them from right to left. Negating a negative value no longer gives an invalid number such as "--1".

Unary operators were folded from left to right in one pass, so in "!-0" the
! was skipped because its operand was not folded yet. Fold them from right to
left. Negating a negative value no longer gives an invalid number such as "--1".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@danmar
danmar merged commit a62b8ee into master Nov 7, 2026
47 checks passed
@danmar
danmar deleted the fix-727 branch November 7, 2026 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants