-
Notifications
You must be signed in to change notification settings - Fork 297
Closed
Labels
Description
Product
BAML
Describe the bug
When type-checking a chained binary expression like a + b + c + d
where identifiers are undeclared, the checker emits multiple Invalid binary operation: cannot infer type of operands
errors in addition to the expected Unknown variable …
errors.
These operator-level diagnostics are cascades from the undeclared names and should be suppressed to avoid noise since inflated error counts and noisy output make real issues harder to spot and degrade developer UX.
Reproduction Steps
- Create a
.baml
file
function SevenErrors() -> int {
a + b + c + d
}
- Run the check or
generate
command - Observe the diagnostics
error: Error validating: Unknown variable a
--> file.baml:2
2 | a + b + c + d
error: Error validating: Unknown variable b
--> file.baml:2
2 | a + b + c + d
error: Error validating: Invalid binary operation: cannot infer type of operands
--> file.baml:2
2 | a + b + c + d
error: Error validating: Unknown variable c
--> file.baml:2
2 | a + b + c + d
error: Error validating: Invalid binary operation: cannot infer type of operands
--> file.baml:2
2 | a + b + c + d
error: Error validating: Unknown variable d
--> file.baml:2
2 | a + b + c + d
error: Error validating: Invalid binary operation: cannot infer type of operands
--> file.baml:2
2 | a + b + c + d
BAML Version
No response
Language/Framework
None
LLM Provider
None
LLM Model
No response
Operating System
Linux
Browser
None
Code Editor
None