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

I can not access a list element with dynamic index #80

Closed
saig0 opened this issue Jan 24, 2020 · 2 comments · Fixed by #82
Closed

I can not access a list element with dynamic index #80

saig0 opened this issue Jan 24, 2020 · 2 comments · Fixed by #82
Assignees
Milestone

Comments

@saig0
Copy link
Member

saig0 commented Jan 24, 2020

Describe the bug
It is not possible to access a list element (i.e. via filter expression) if the index is a variable reference instead of a constant number.

["a","b","c"][2]
// "b"

["a","b","c"][index]
// failure: expected Boolean but found 'ValNumber(2)'

To Reproduce
Steps to reproduce the behavior:

  1. Evaluate a filter expression ["a","b","c"][index] with context variable index = 2

Expected behavior
I can access a list element statically and dynamically with a variable reference in the same way.

Environment
Which version do you use? 1.10.0

@saig0 saig0 self-assigned this Jan 24, 2020
@saig0 saig0 added this to the 1.11.0 milestone Jan 28, 2020
@falko
Copy link
Member

falko commented Jan 29, 2020

@saig0 Should this become a TCK test?

@saig0
Copy link
Member Author

saig0 commented Jan 30, 2020

I didn't check the newest TCK tests yet. But it would make sense to have also test with non-static values :)

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

Successfully merging a pull request may close this issue.

2 participants