You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is correct behavior when the output type is known, since the conversion type selection logic already proved that a conversion between the in and out types is valid, but if the output type is DynamicPseudoType this causes the result to be DynamicVal, losing the original type information in the unknown value.
Instead, we should treat DynamicPseudoType as a further special case and just return the given unknown value verbatim if that is selected as the output type.
(Converting to dynamic is a strange thing to do specifically, but this behavior is intended as a convenience for callers that are doing a conversion on behalf of a transitive caller that is specifying a target type, so that such intermediate callers don't need to themselves handle this as a special case.)
The text was updated successfully, but these errors were encountered:
The intended meaning of a conversion to
DynamicPseudoType
is to take no conversion action whatsoever and just return the given value verbatim.This works for known values, but due to a special case for unknown values does not behave as expected for those:
go-cty/cty/convert/conversion.go
Lines 20 to 22 in 88fbe72
This is correct behavior when the output type is known, since the conversion type selection logic already proved that a conversion between the in and out types is valid, but if the output type is
DynamicPseudoType
this causes the result to beDynamicVal
, losing the original type information in the unknown value.Instead, we should treat
DynamicPseudoType
as a further special case and just return the given unknown value verbatim if that is selected as the output type.(Converting to dynamic is a strange thing to do specifically, but this behavior is intended as a convenience for callers that are doing a conversion on behalf of a transitive caller that is specifying a target type, so that such intermediate callers don't need to themselves handle this as a special case.)
The text was updated successfully, but these errors were encountered: