lwt icon indicating copy to clipboard operation
lwt copied to clipboard

Wrong type annotations with Lwt_ppx 5.9.2

Open Halbaroth opened this issue 1 month ago • 1 comments

It seems that Lwt_ppx no longer inserts type annotations at the right location. The following code:

let main () =
  let%lwt (_ : int) = Lwt.return 0 in 
  Lwt.return_unit

was transformed into:

let main () =
  let __ppx_lwt_0 = Lwt.return 0 in
  Lwt.backtrace_bind (fun exn -> try Lwt.reraise exn with | exn -> exn)
    __ppx_lwt_0 (fun (_ : int) -> Lwt.return_unit)

by Lwt_ppx 5.9.1 but Lwt_ppx 5.9.2 now outputs:

let main () =
  let __ppx_lwt_0 : int = Lwt.return 0 in
  Lwt.backtrace_bind (fun exn -> try Lwt.reraise exn with | exn -> exn)
    __ppx_lwt_0 (fun _ -> Lwt.return_unit)

Halbaroth avatar Nov 08 '25 11:11 Halbaroth

thanks for the bug report, I'll look into it

raphael-proust avatar Nov 20 '25 10:11 raphael-proust