Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weird error when iterating over object #121

Closed
sparkprime opened this issue Mar 8, 2016 · 1 comment
Closed

Weird error when iterating over object #121

sparkprime opened this issue Mar 8, 2016 · 1 comment
Labels

Comments

@sparkprime
Copy link
Contributor

$ jsonnet -e '[x for x in {a: "foo"}]'
RUNTIME ERROR: Object index must be string, got double.
                thunk <x>
        <cmdline>:1:2   thunk <array_element>
        During manifestation
@sparkprime sparkprime added the bug label Mar 8, 2016
@sparkprime
Copy link
Contributor Author

Probably the code is doing x[i] for i in std.range(0, std.length({a: "foo"})} and length of an object is the number of keys. Best thing to do right now is to put an explicit check in that it's an array and not an object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant