google / google/go-jsonnet

bad error message with list comprehension over object

Open
#340 4 comments 1 reaction 0 assignees View on GitHub
error reporting
Dominant language
Go
Stars
1.8k
Forks
263
PR merge metrics
No merged PRs in 30d

Description

Somewhere deep in my nested object, a list got accidentally replaced with an object.
Minimal working example:
```
jsonnet -e '[a for a in {}]'
```

The error I get with go-jsonnet is:
```
RUNTIME ERROR: Unexpected type object, expected array
builtin function
During evaluation
```
Without telling me what happened or even where. After a while I gave up and tried the c++ version, which gave me:

```
RUNTIME ERROR: In comprehension, can only iterate over array.
:1:1-16
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.