Gecode / gecode

Generic Constraint Development Environment
https://www.gecode.org
Other
275 stars 76 forks source link

Allow par identifiers var array initialisers for FlatZinc #192

Closed cyderize closed 8 months ago

cyderize commented 9 months ago

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 commented 8 months ago

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!

cyderize commented 8 months ago

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.