rescript-lang / rescript-core

A drop-in standard library for ReScript. Intended to be familiar for JavaScript developers, easy to use, and be rich enough (without being bloated) so that you don't need to reach for anything else for typical ReScript development.
MIT License
163 stars 29 forks source link

v1.3.0 compile error when "uncurried": false in Rescript-v11.1.0 #214

Closed dsiu closed 7 months ago

dsiu commented 7 months ago

Is "uncurried": false even supported for rescript-core?

FAILED: src/Core__Int.cmj

  We've found a bug for you!
  /Users/dsiu/code/playground/rescript-core/src/Core__Int.res:34:13-35

  32 ┆ let maybeInt = switch radix {
  33 ┆ | Some(radix) => Core__Float.parseInt(x, ~radix)
  34 ┆ | None => Core__Float.parseInt(x)
  35 ┆ }
  36 ┆ 

  This call is missing an argument of type (?radix: option<int>)
rescript: [2/32] src/Core__List.cmj
FAILED: src/Core__List.cmj

  We've found a bug for you!
  /Users/dsiu/code/playground/rescript-core/src/Core__List.res:582:39

  580 │     reduceReverseUnsafe(l, acc, f)
  581 │   } else {
  582 │     A.reduceReverseU(toArray(l), acc, f)
  583 │   }
  584 │ }

  This function is a curried function where an uncurried function is expected

FAILED: cannot make progress due to previous errors.
>>>> Finish compiling (exit: 1)
cknitt commented 7 months ago

No, you are right, 1.3.0 contains changes like in the above parseInt function that require uncurried mode so that you can have optional args without requiring the trailing unit argument.

This should of course be documented, I will create a PR to update the README.

cknitt commented 7 months ago

Updated README in #215.