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

Allow par identifiers var array initialisers for FlatZinc #192

Merged
merged 2 commits into from
Dec 14, 2023

Conversation

cyderize
Copy link

@cyderize cyderize commented Dec 8, 2023

Previously, the parser would reject par identifiers inside the initializers for arrays of var declarations, but this should (theoretically) be allowed (although the MiniZinc compiler has now been changed to never produce this).

Also adds a missing check for restart_data preventing a possible crash.

@cyderize
Copy link
Author

Hi @zayenz, we're trying to get a release of MiniZinc out soon, so it would be great if you could have a look at this (to fix MiniZinc/libminizinc#756). Thanks!

Copy link
Member

@zayenz zayenz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for completeness, is there any way that say an int constant would be put in a float variable array?

Otherwise, looks great.

@zayenz zayenz merged commit 4a00bc5 into Gecode:release/6.3.0 Dec 14, 2023
5 checks passed
@cyderize
Copy link
Author

Thanks for merging! :)

The MiniZinc compiler never puts integer literals in float arrays (and if it did I would consider that a bug in the compiler), but I guess the specification of FlatZinc doesn't really say what a well-typed program looks like - maybe we should explicitly mention that no subtyping is allowed other than par/var.

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

Successfully merging this pull request may close these issues.

2 participants