Cannot access a list item with an expression
Describe the Bug
If I put an expression in the brackets, I get null results instead of the value, even though the expression evaluates to a number.
Steps to Reproduce
https://nikku.github.io/feel-playground/?e=for+i+in+2..count%28l%29+return+l%5Bi%5D+%2B+l%5Bi-1%5D&c=%7B%0A++%22l%22%3A+%5B2%2C3%2C5%2C8%2C13%5D%0A%7D&t=expression&st=true
There is a workaround: https://nikku.github.io/feel-playground/?e=for+i+in+2..count%28l%29+return+l%5Bi%5D+%2B+l%5B%7Br%3A+i-1%7D.r%5D&c=%7B%0A++%22l%22%3A+%5B2%2C3%2C5%2C8%2C13%5D%0A%7D&t=expression&st=true
Expected Behavior
Element of the given index is accessed.
Environment
- Host (Browser/Node version), if applicable: [e.g. MS Edge 18, Chrome 69, Node 10 LTS]
- OS: [e.g. Windows 7]
- Library version: [e.g. 2.0.0]
Context
Related to https://jira.camunda.com/browse/SUPPORT-29896
What is probably happening is that we interpret the expression as a filter.
This is a bug. Thanks for the good report!