Gecode / gecode

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

Improved Literal out of bounds error message #48

Closed Dekker1 closed 5 years ago

Dekker1 commented 5 years ago

This PR contains just change to an error message in the FlatZinc parser. MiniZinc can produce 64 bit integer literals, but these are out of the bounds of Gecode. The current message would be:

Error: invalid integer literal in line no. 21

As issues regarding the limits are the only reason for this message occurring I would suggest changing it to:

Error: The literal '3486784401' of the type int is out of range (-2147483646..2147483646) in line no. 21

In the MiniZinc Coursera courses, various students have been confused about this error message and I think this will resolve the problem.

zayenz commented 5 years ago

Nice, the old message was indeed confusing. LGTM.

chschulte commented 5 years ago

Thanks, Yip!