Closed apparentlymart closed 6 years ago
This is added in 074b73b8b58cbec2cde9e8d95c38101687ea016a.
Decided not to generate a warning after all, since we're already supporting the legacy splat syntax and its associated legacy index form and this is really just a logical extension of that. It's sad to have these weird forms in the language forever, but doesn't hurt too much in practice.
Due to limitations of HIL, Terraform has for a long time been supporting a weird index syntax using numeric "attributes", like
data.alicloud_zones.default.zones.0.id
. From HIL's perspective, that all just one long variable name with dots and digits in it.Our expression parser currently rejects this because
0
is not a valid attribute name. Since identifiers cannot start with zero, it's safe for us to accept this as an alias fordata.alicloud_zones.default.zones[0].id
, though we may generate a warning in this case because that odd old form is deprecated now that we support proper attribute and index operators.