Resi conflict when uncurried (v11)

Getting error when creating a resi file using uncurried in v11:

The implementation /ventas/src/components/PvcWindow.res
  does not match the interface src/components/pvcWindow-Ventas.cmi:
  ...
  In module PageEdit:
  Values do not match:
    let make: props<option<string>, option<string>> => React.element (uncurried)
  is not included in
    let make: React.componentLike<
  props<option<string>, option<string>>,
  React.element,
> (curried)
  /ventas/src/components/PvcWindow.resi:2:3-3:79:
    Expected declaration
  /ventas/src/components/PvcWindow.res:6094:7-10:
    Actual declaration

rescript.json

{
  "uncurried": false,
  "name": "ventas",
  "sources": [
    { "dir": "src/components", "subdirs": false },
    { "dir": "src/tests", "subdirs": false, "type": "dev" }
  ],
  "package-specs": [
    {
      "module": "es6",
      "in-source": true
    }
  ],
  "bs-dependencies": ["@rescript/react", "@ryyppy/rescript-promise"],
  "bs-dev-dependencies": [],
  "suffix": ".res.js",
  "reanalyze": {
    "analysis": ["dce", "exception"]
  },
  "jsx": { "version": 4, "mode": "automatic" },

  "warnings": {
    "number": "+A-42-48",
    "error": "+A-3-44-102-103"
  },
  "namespace": true
}

PvcWindow.res:

@@uncurried
module PageEdit = {
  @react.component
  let make = (~itemId: option<string>, ~stepId: option<string>) => {
   //  ...
  }
}

PvcWindow.resi:

module PageEdit: {
  @react.component
  let make: (~itemId: option<string>, ~stepId: option<string>) => React.element
}

Dependencies:

  • "@rescript/react": "^0.12.1",
  • "rescript": "11.0.1",

Any idea on how to fix the resi? It works fine without the resi.

You should add @@uncurried to interface as well

I tried but doesn’t seem to have any effect on it. Same error

I don’t know then. I actually also tried to use @@uncurried to gradually migrate our codebase to uncurried mode. But I failed because uncurried and curried code got mixed it and didn’t work well together. So instead of using @@uncurried I just enabled uncurried mode for the whole project and it happened to be much easier to fix a few places with compilation error. But first, you need to make all your dependencies work in both curried and uncurried modes.

2 Likes