Hello everyone,
Can someone explain this to me ?
let log_name = (first_name, ~last_name=?) => {
switch last_name {
| None => Console.log2(first_name, "Noname")
| Some(last_name) => Console.log2(first_name, last_name)
}
}
let ada = "Ada"
// this is OK
log_name(ada)
// this is OK too
ada->log_name(~last_name="Lovelace")
// this is not OK
ada->log_name()
Error message is:
We've found a bug for you!
/.../__tests__/Demo_test.res:34:17
32 β ada->log_name(~last_name="Lovelace")
33 β // this is not
34 β ada->log_name()
35 β
36 β Assert.pass(~message="OK")
The function applied to this argument has type
('a, ~last_name: 'b=?) => unit
This argument cannot be applied without label