autounravel
is legal ¶The autounravel
modifier implies static
and can be used
in many of the same places as static
. However, specifying
autounravel
at the top level of a module (i.e.,
outside of any structure or function) is an error, whereas static
gives only a warning. 1
In front of a struct
definition or typedef
statement,
autounravel
is forbidden because types cannot be autounraveled.
While static static
results in an error,
static autounravel
and autounravel static
are both legal
and have exactly the same effect as autounravel
alone.
If top-level autounravel
were allowed,
a user might incorrectly assume that the field would be unraveled
whenever the module is access
ed. The static
modifier
is allowed at the top level because, while it does nothing, it does
not mislead the user.