Skip to content

Commit

Permalink
Add a comment
Browse files Browse the repository at this point in the history
pselle committed Aug 2, 2019
1 parent cd83e61 commit 234c1c4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lang/blocktoattr/variables.go
Original file line number Diff line number Diff line change
@@ -34,6 +34,8 @@ func walkVariables(node dynblock.WalkVariablesNode, body hcl.Body, schema *confi
if blockS, exists := schema.BlockTypes[child.BlockTypeName]; exists {
vars = append(vars, walkVariables(child.Node, child.Body(), &blockS.Block)...)
} else if attrS, exists := schema.Attributes[child.BlockTypeName]; exists && attrS.Type.IsCollectionType() && attrS.Type.ElementType().IsObjectType() {
// ☝️Check for collection type before element type, because if this is a mis-placed reference,
// a panic here will prevent other useful diags from being elevated to show the user what to fix
synthSchema := SchemaForCtyElementType(attrS.Type.ElementType())
vars = append(vars, walkVariables(child.Node, child.Body(), synthSchema)...)
}

0 comments on commit 234c1c4

Please sign in to comment.