google-research / dex-lang

Research language for array processing in the Haskell/ML family
BSD 3-Clause "New" or "Revised" License
1.58k stars 106 forks source link

Can't count function arguments #1265

Closed axch closed 1 year ago

axch commented 1 year ago
rand_vec(5, internal_cast, a=Float32)
> Type error:Wrong number of arugments provided. Expected 3 but got 2
>
> rand_vec(5, internal_cast, a=Float32)
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

But I clearly passed three arguments! The actual complaint is about a missing third explicit (i.e., positional) argument; this error message is terrible.

dougalm commented 1 year ago

would it be enough to just change the message to "wrong number of positional arugments provided"? We could even spell it as "arguments" which is more traditional.