zclconf / go-cty

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

cty: AsBigFloat does a shallow copy #114

Closed jbardin closed 3 years ago

jbardin commented 3 years ago

Use Float.Copy in AsBigFloat to ensure that there is no shared data between the mutable *big.Float and the cty.Value internal state.

Without the Copy, the given test will output:

original value changed from cty.NumberFloatVal(1.9) to cty.NumberIntVal(1)