Skip to content

bad error message with list comprehension over object #340

Open
@jarondl

Description

@jarondl

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 <flatMap>
	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.
	<cmdline>:1:1-16

Metadata

Metadata

Assignees

No one assigned

    Labels

    error reportingHow the errors are handled (e.g. stack trace quality)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions