Skip to content

Report non-bool operands of logical operators as type mismatches. - #1382

Merged
copybara-service[bot] merged 1 commit into
mainfrom
test_1002989610
Oct 22, 2026
Merged

copybara-service[bot] merged 1 commit into
mainfrom
test_1002989610

Conversation

@copybara-service

Copy link
Copy Markdown
Contributor

Report non-bool operands of logical operators as type mismatches.

When an operand of && or || isn't a bool, the type-checker reports that no overload matches, e.g. found no matching overload for '_&&_' applied to '(bool, int)'. This is especially confusing for the all and exists macros: their predicates are expanded into these operators, which don't appear in the expression, and the error doesn't point at the predicate.

@copybara-service
copybara-service Bot force-pushed the test_1002989610 branch 14 times, most recently from 9600c73 to e8d4024 Compare October 22, 2026 08:57
When an operand of `&&` or `||` isn't a bool, the type-checker reports that no overload matches, e.g. `found no matching overload for '_&&_' applied to '(bool, int)'`. This is especially confusing for the `all` and `exists` macros: their predicates are expanded into these operators, which don't appear in the expression, and the error doesn't point at the predicate.

PiperOrigin-RevId: 1004614536
@copybara-service
copybara-service Bot merged commit 9f35821 into main Oct 22, 2026
6 checks passed
@copybara-service
copybara-service Bot deleted the test_1002989610 branch October 22, 2026 09:34
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.

0 participants