ppx_minidebug icon indicating copy to clipboard operation
ppx_minidebug copied to clipboard

A funny error when modifying a type constraint on a let-binding pattern

Open lukstafi opened this issue 1 year ago • 0 comments

The example error, from the test suite:

Error: This expression has type
         (module Minidebug_runtime.PrintBox_runtime) -> int list -> int
       but an expression was expected of type
         (module Minidebug_runtime.PrintBox_runtime) -> int list -> int
       Type int list -> int is not compatible with type int list -> int

This happens for:

  let%track_rtb_show baz : int list -> int = function
    | [] -> 7
    | [ y ] -> y * 2
    | [ y; z ] -> y + z
    | y :: z :: _ -> y + z + 1
  in

See dealing with runtime_from_arg at the end of debug_binding in ppx_minidebug.ml.

lukstafi avatar Feb 07 '24 21:02 lukstafi