Skip to content

Reflection-roundtrip bug happening when chaining is not used #6177

@Baccata

Description

@Baccata

Reproduction

The roundtripBug function below returns Right +1, no matter its input.
The roundtripOkay function below behaves okay

scratch/main> lib.install @unison/base/releases/7.15.0
main = do
  roundtripBug : x ->{IO, Exception} Either [Link.Term] x
  roundtripBug x =
    Value.load (Value.deserialize (Value.serialize 5 (Value.value x)))
  roundtripOk : x ->{IO, Exception} Either [Link.Term] x
  roundtripOk x =
    x |> Value.value |> Value.serialize 5 |> Value.deserialize |> Value.load
  roundtripBug [1, 2, 3] |> Debug.trace "bug"
  roundtripOk [1, 2, 3] |> Debug.trace "okay"
scratch/main> run main

Environment

  • ucm --version : "1.1.1"
  • OS/Architecture: : macos 15.6.1 (24G90), M1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions