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

Error for references in mdl or cst guards #191

Merged
merged 2 commits into from
Oct 28, 2021
Merged

Conversation

jefft0
Copy link
Collaborator

@jefft0 jefft0 commented Oct 27, 2021

As explained in issue #133, a guard like (= A x) in a model or cst does not have the expected result. This is because the code for the guard checker doesn't support references to an object like x. Adding support for references in guards is more difficult than expected, so this pull request is a temporary solution to show an error if the uses adds a model or cst to the seed code where the guard has a referenced object.

This pull request has two commits. The first commit adds the utility method has_reference to the Utils class. The second commit uses it in _Mem::load: As the objects from the seed code are being loaded, it checks if the guards of each model or cst has a referenced object. If so, it prints an error like the following and quits.

ERROR: Illegal referenced object in forward guards of model OID 63

@jefft0 jefft0 merged commit 94ba486 into master Oct 28, 2021
@jefft0 jefft0 deleted the error-hlp-guard-references branch October 28, 2021 14:57
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.

1 participant