We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Version flatzinc 0.3.21
Use case Get a parameter identifier.
Current behavior I have to match the ParDeclItem over all types to get its id.
ParDeclItem
id
fn get_id(parameter: ParDeclItem) -> String { match parameter { ParDeclItem::Bool { id, bool: _ } => id, ParDeclItem::Int { id, int: _ } => id, ParDeclItem::Float { id, float: _ } => id, ParDeclItem::SetOfInt { id, set_literal: _ } => id, ParDeclItem::ArrayOfBool { ix: _, id, v: _ } => id, ParDeclItem::ArrayOfInt { ix: _, id, v: _ } => id, ParDeclItem::ArrayOfFloat { ix: _, id, v: _ } => id, ParDeclItem::ArrayOfSet { ix: _, id, v: _ } => id, } }
Expected behavior I can easily access the identifier via an attribute.
fn get_id(parameter: ParDeclItem) -> String { parameter.id }
Remark The problem is the same with for accessing a variable identifier (in VarDeclItem).
VarDeclItem
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Version
flatzinc 0.3.21
Use case
Get a parameter identifier.
Current behavior
I have to match the
ParDeclItem
over all types to get itsid
.Expected behavior
I can easily access the identifier via an attribute.
Remark
The problem is the same with for accessing a variable identifier (in
VarDeclItem
).The text was updated successfully, but these errors were encountered: