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
The parser currently accepts parsing attributes on type alias declarations, e.g., this alias is accepted:
type Addr = addr &ipv4;
Using this alias triggers an error though:
typeX=unit{
: Addr;# ERROR: address field must come with either &ipv4 or &ipv6 attribute};
This is due to us accepting the attribute on the alias, but ignoring it (correctly since here &ipv4 is not an proper attribute for a type, but only a field). In this case this is just confusing, but could make it to silently introduce bugs if attributes like e.g., &requires or &max-size. See e.g., #1845 (comment) where this cause confused a user.
I feel we should outright reject such attributes with a diagnostic.
The text was updated successfully, but these errors were encountered:
The parser currently accepts parsing attributes on type alias declarations, e.g., this alias is accepted:
Using this alias triggers an error though:
This is due to us accepting the attribute on the alias, but ignoring it (correctly since here
&ipv4
is not an proper attribute for a type, but only a field). In this case this is just confusing, but could make it to silently introduce bugs if attributes like e.g.,&requires
or&max-size
. See e.g., #1845 (comment) where this cause confused a user.I feel we should outright reject such attributes with a diagnostic.
The text was updated successfully, but these errors were encountered: