-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cty: add CanListVal, CanSetVal, CanMapVal
The logic which may result in a panic in List(), Map() and Set() has been extracted into these helper functions, which return bools. The original callers are unchanged, so that they can still return an element-specific panic message. These new functions are called in the appropriate conversion functions in the convert package to validate that the given elements can be used to create a single Type, to help reduce the number of panics that occur when calling Convert. For additional background information on the (odd) scenarios that can lead to these panics, see hashicorp/terraform#26195
- Loading branch information
1 parent
080b168
commit 129cba3
Showing
3 changed files
with
387 additions
and
24 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
Oops, something went wrong.