Skip to content

wrong error message in uncurried mode #6413

Closed
@tsnobip

Description

@tsnobip

I've noticed a bug in the error message that is provided when you are in uncurried mode and you provide a curried function to an uncurried signature:

module Foo: {
  let get: (Js.Dict.t<'a>, Js.Dict.key) => option<'a>
} = {
  let get = Js.Dict.get
}

this yields the following error:

[E] Line 3, column 4:

Signature mismatch:
  ...
  Values do not match:
    let get: (Js.Dict.t<'a>, Js.Dict.key) => option<'a>
  is not included in
    let get: (Js.Dict.t<'a>, Js.Dict.key) => option<'a>
  playground.res:2:3-53: Expected declaration
  playground.res:4:7-9: Actual declaration

Tested in v11.0.0-rc.3 (playground link).

Interestingly enough, it shows the correct error message when inlining the signature:

let get: (Js.Dict.t<'a>, Js.Dict.key) => option<'a> = Js.Dict.get
This function is a curried function where an uncurried function is expected

Originally got suspicious about this bug from this post on the forum.

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