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

Evaluation error of arrays in comprehension assignment #858

Open
CervEdin opened this issue Oct 18, 2024 · 1 comment
Open

Evaluation error of arrays in comprehension assignment #858

CervEdin opened this issue Oct 18, 2024 · 1 comment
Labels
bug resolved Issue is resolved and the feature or fix will be part of next release

Comments

@CervEdin
Copy link

If I use assignment of arrays in comprehensions like this

array[int, int] of int: foos = [| 1, 0 |];

output [
  show([ r[1] | t=foos, i in index_set_1of2(t), r=t[i, ..] ]), % error
  show([ r[1] | i in index_set_1of2(foos), t=foos, r=t[i, ..] ]), % error
  show([ r[1] | i in 1..1, t=foos, r=t[i, ..] ]), % error
  "\n",
];

playground.mzn

I end up with

MiniZinc: evaluation error: index_set: wrong dimension

in MiniZinc 2.8.4+
in MiniZinc 2.8.3-
it's instead

Error: evaluation error: arrays of arrays not supported

Possibly related to issue #807

@CervEdin CervEdin changed the title Evaluation error in comprehension assignment Evaluation error of arrays in comprehension assignment Oct 18, 2024
@CervEdin
Copy link
Author

interestingly, this is OK

  show([ r | i in index_set_1of2(foos), t=foos, r=t[i, 1] ]), % OK

but this is not

  show([ r | t=foos, i in index_set_1of2(t), r=t[i, 1] ]), % error

@cyderize cyderize added the bug label Oct 22, 2024
guidotack pushed a commit that referenced this issue Oct 29, 2024
@cyderize cyderize added the resolved Issue is resolved and the feature or fix will be part of next release label Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug resolved Issue is resolved and the feature or fix will be part of next release
Projects
None yet
Development

No branches or pull requests

2 participants