Skip to content

Review uncurried error messages. #5888

Closed
@cristianoc

Description

@cristianoc

After changing to the new representation of uncurried functions (#5870) there are a few places in the codebase that used to generate error messages for which there were no tests:

  • 1 fprintf ppf "This function has uncurried type, it needs to be applied in ucurried style" in Typecore. Same as 3, and overridden in Super_typecore.
  • 2 fprintf ppf "This expression is excpeted to have an uncurried function" in Typecore. Same as 4 but misspelled and overridden in Super_typecore.
  • 3 This is an uncurried ReScript function. @{<info>It must be applied with a dot@}.@ in Super_typecore Remove errors for curried application of uncurried functions. #5890
let foo = (. x, y) => x+1
let z = foo( 1)
let apply = (f) => f(. 1)
let z = apply(x => x+1)
let nonfun = 2
let _ = nonfun(. 3)

Old error:

This has type: int
  Somewhere wanted: Js.Fn.arity1<'a>

New error:

 This has type: int
  Somewhere wanted: \"function$"<'a, [#Has_arity1]>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions