zclconf / go-cty

A type system for dynamic values in Go applications
MIT License
348 stars 71 forks source link

account for null literal values in function args #174

Closed jbardin closed 11 months ago

jbardin commented 11 months ago

The common usage of cty will handle a null literal value as a NullVal(DynamicPseudoType), which is a valid argument to any function parameter allowing nullable values even without AllowDynamicType. Rather than forcing callers to always convert arguments to take this case into account, we return the expected type since the null value is wholly known.

jbardin commented 11 months ago

We're going to ensure implementations always use AllowDynamicType when dealing with DynamicPseudoType here rather than handling another special case to track in the implementation.