-
-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
function: Don't call function Impl if we didn't call Type
By default cty function calls "short circuit" -- skip calling the Type function and just immediately return cty.DynamicPseudoType -- if any of the arguments are cty.DynamicVal. However, in that case we were previously only skipping the call to Type but yet still expecting Impl to be able to run. That's incorrect because Impl functions should be able to treat Type as a "guard" and be guaranteed that Impl will never run if Type failed. To fix that hole we'll now track whether we skipped calling Type, and if so we'll also skip calling Impl and just immediately return an unknown value. Individual functions can still opt out of this behavior by declaring on or more of their parameters as AllowDynamicType: true, in which case their own Type function will get to decide how to handle that situation.
- Loading branch information
1 parent
0401e09
commit e9ad14f
Showing
3 changed files
with
47 additions
and
18 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