go-jsonnet reports static errors in tla-codes imports differently to c++
- Dominant language
- Go
- Stars
- 1.8k
- Forks
- 263
- PR merge metrics
- No merged PRs in 30d
Description
Suppose I have a top-level function which takes an arg (trivial function used here for simplicity):
```
function(foo) foo
```
Now suppose I specify a top-level arg using tla-code that imports some other file:
`--tla-code 'foo=import "foo.jsonnet"'`
However, that file contains a syntax error:
```
$ cat foo.jsonnet
not valid
```
Here is the result of running this with c++ jsonnet:
```
$ jsonnet --tla-code foo='import "foo.jsonnet"' -e 'function(foo) foo'
STATIC ERROR: foo.jsonnet:1:5-10: did not expect: (IDENTIFIER, "valid")
```
Here is the result with go-jsonnet:
```
$ go-jsonnet --tla-code foo='import "foo.jsonnet"' -e 'function(foo) foo'
RUNTIME ERROR: foo.jsonnet:1:5-10 Did not expect: (IDENTIFIER, "valid")
:1:1-21 $
:1:15-18 function
Top-level function
```
The same behaviour occurs if you replace `--tla-code foo='import "foo.jsonnet"'` with `--tla-code-file foo=foo.jsonnet`.
Contributor guide
Assessment
This issue has not been assessed yet.