You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
meaning that an alternative between two rules/parsers that have the same attribute type will have an attribute that is the same as that common type (instead of a variant of the individual types).
However, this is not the case. Alternatives such as the above still result in an attribute of type variant< A, A >.
While (I think?) automatic propagation rules can correctly propagate this to an attribute of type A, this is a problem/inconvenience for e.g. semantic actions as they get the immediate attribute type and thus have to work with the variant.
The text was updated successfully, but these errors were encountered:
Krzmbrzl
changed the title
Incorrect attribute propagation for alternatives with equal attributes
X3: Incorrect attribute propagation for alternatives with equal attributes
Sep 22, 2023
The docs state
meaning that an alternative between two rules/parsers that have the same attribute type will have an attribute that is the same as that common type (instead of a variant of the individual types).
However, this is not the case. Alternatives such as the above still result in an attribute of type
variant< A, A >
.While (I think?) automatic propagation rules can correctly propagate this to an attribute of type
A
, this is a problem/inconvenience for e.g. semantic actions as they get the immediate attribute type and thus have to work with the variant.MWE (Godbolt):
The text was updated successfully, but these errors were encountered: