Skip to content

[BUG] labelled arguments stopped working #2126

@tari3x

Description

@tari3x

Describe the bug
I upgraded to 6.2.0 (will look up the previous version later). Previously I was able to describe JS APIs like this:

  class type js = object
    method drawCircle : x:float -> y:float -> radius:float -> unit meth
  end

Now I get an error when trying to call it:

  let draw_circle (t : t) ~x ~y ~radius : unit =
    t##drawCircle ~x ~y ~radius

Error: This expression has type
         "'t16 ->
         't17 ->
         (< addChild : Pixi_lib__Raw.DisplayObject.t -> unit Js.meth;
            clear : unit Js.meth; closePath : unit Js.meth;
            container_witness : Container.witness;
            display_object_witness : DisplayObject.witness;
            drawCircle : x:float -> y:float -> radius:float -> unit Js.meth;
            drawRect : x:float ->
                       y:float -> width:float -> height:float -> unit Js.meth;
            fill : Pixi_lib__Raw.FillStyle.t -> unit Js.meth;
            graphics_witness : witness; height : float Js.readonly_prop;
            lineTo : float -> float -> unit Js.meth;
            moveTo : float -> float -> unit Js.meth;
            setFromMatrix : Pixi_lib__Raw.Matrix.t -> unit Js.meth;
            stroke : Pixi_lib__Raw.StrokeStyle.t -> unit Js.meth;
            updateLocalTransform : unit Js.meth;
            width : float Js.readonly_prop > ->
          x:(< drawCircle : 'a; .. > -> 'a) ->
          y:'t16 -> radius:'t17 -> (x:'b -> y:'c -> radius:'d -> 'e) Js.meth) ->
         'e"
       but an expression was expected of type "unit"

Expected behavior

Tbh, I suspect this was never supposed to work, at least judging by #506

But I did really appreciate labelled arguments for all the obvious reasons, and I'm sad that a lot of previous code broke.

Versions
6.2.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions