Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The CUE input import "strconv" complex: strconv.ParseComplex("+3i", 64) fails on master as well as v0.10.0 and older versions like v0.8.2: complex: unsupported Go type (complex128) This is because strconv.ParseComplex returns a complex128 Go value, and the internal/core/convert logic used to translate from Go values to CUE values does not handle complex128, given that CUE does not have direct support for complex numbers in the language spec. One option would be to rewrite strconv.ParseComplex to return a string, as a form of validator which would canonicalize complex number strings. This is how CUE's time.Parse API works; it returns a string given that the CUE language does not have direct support for timestamps. However, given that strconv.ParseComplex never worked, and it's not clear that it is needed, particularly as noone complained, remove it for the time being. Remove the switch case in pkg/gen.go too. Signed-off-by: Daniel Martí <[email protected]> Change-Id: I96e327a61bbc5e9a620214540f7402131aa3f793 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1201115 Unity-Result: CUE porcuepine <[email protected]> Reviewed-by: Roger Peppe <[email protected]> TryBot-Result: CUEcueckoo <[email protected]>
- Loading branch information