Skip to content

Wrong type annotations with Lwt_ppx 5.9.2 #1085

@Halbaroth

Description

@Halbaroth

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions