forked from hashicorp/hcl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hcldec: Handle or forbid cty.DynamicPseudoType attributes in nested b…
…locks Our BlockList, BlockSet, and BlockMap specs all produce cty collection values, which require all elements to have a homogeneous type. If the nested spec contained an attribute of type cty.DynamicPseudoType, that would create the risk of each element having a different type, which would previously have caused decoding to panic. Now we either handle this during decode (BlockList, BlockSet) or forbid it outright (BlockMap) to prevent that crash. BlockMap could _potentially_ also handle this during decode, but that would require a more significant reorganization of its implementation than I want to take on right now, and decoding dynamically-typed values inside collections is an edge case anyway.
- Loading branch information
1 parent
d6049c2
commit b82170e
Showing
3 changed files
with
174 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters