-
-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
function: don't pass unexpected marked values to TypeFunc #92
Conversation
ReturnTypeForValues was only checking an unmarking the top level value for TypeFuncs that did not expect marked values. Use ContainsMarked and UnmarkDeep to prepare the arguments.
Codecov Report
@@ Coverage Diff @@
## main #92 +/- ##
==========================================
+ Coverage 70.85% 70.94% +0.09%
==========================================
Files 79 79
Lines 6636 6636
==========================================
+ Hits 4702 4708 +6
+ Misses 1490 1486 -4
+ Partials 444 442 -2
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is good as far as safety I can think through on acceptable disclosure w.r.t. the types 🤔 I am surprised we haven't run into this as yet, so just so I can completely grok, do you have an example of where this is useful/what this is addressing?
Hi @pselle , this particular case takes a combination of constructing values which contain marked values, and passing them to a function which needs to calculate the return type based on those values. The corresponding Terraform issue is: hashicorp/terraform#28049. |
This makes sense to me, so thanks! I think in retrospect this was a missing part of #72 that I neglected to catch during review. The similar code for this in |
ReturnTypeForValues
was only checking an unmarking the top level valuefor
TypeFunc
s that did not expect marked values. UseContainsMarked
andUnmarkDeep
to prepare the arguments.