Better error on mismatched binary operator
Open
error reporting
- Dominant language
- Go
- Stars
- 1.8k
- Forks
- 263
- PR merge metrics
- No merged PRs in 30d
Description
Consider this invalid snippet:
```jsonnet
{
abc: null
} + {
abc+: {
foo: "bar"
}
}
```
First, surprised me that it is invalid after all, because I assumed I could add `object` and `null` (which is represents "nothing", right?).
More importantly, the error message printed by `go-jsonnet` is pretty useless:
```
RUNTIME ERROR: Unexpected type null
During manifestation
```
While the one of `c++-jsonnet` is much better:
```
RUNTIME ERROR: binary operator + requires matching types, got null and object.
test.jsonnet:(3:5)-(7:2) object
During manifestation
```
Contributor guide
Assessment
This issue has not been assessed yet.