---
cases:
  - note: varreferences/mixed
    query: data.generated.p = x
    modules:
      - |
        package generated

        p[x] := y if {
        	v = [{"a": 1, "b": 2}, {"c": 3, "z": [4]}]
        	y = v[i][x][j]
        }
    data: {}
    want_result:
      - x:
          z: 4
