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

showJSON encodes array of enum inside record as array of int #793

Closed
CervEdin opened this issue Feb 28, 2024 · 0 comments
Closed

showJSON encodes array of enum inside record as array of int #793

CervEdin opened this issue Feb 28, 2024 · 0 comments
Labels
bug resolved Issue is resolved and the feature or fix will be part of next release

Comments

@CervEdin
Copy link

Given the following model.mzn

enum e = { A };

array[int] of e: As = [ A ];
record( array[int] of e: as ): foo = (as: As);

output [
  showJSON(foo), "\n",
  showJSON(As),
];

Expected output

{"as": [{"e":"A"}]}
[{"e":"A"}]
----------

Actual output

{"as": [1]}
[{"e":"A"}]
----------

I expected that the array[int] of e, inside the record, would be encoded as a array[int] of e
instead it's encoded as an array[int] of int.
Thinking this is maybe a bug.

This was observed in

MiniZinc to FlatZinc converter, version 2.7.6, build 905165378

running on

Ubuntu 22.04.3 LTS
Linux 5.15.133.1-microsoft-standard-WSL2
@cyderize cyderize added the bug label Feb 29, 2024
@cyderize cyderize added the resolved Issue is resolved and the feature or fix will be part of next release label Mar 14, 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