mlscript
mlscript copied to clipboard
Optional Arguments
Draft PR:
- Resolved merge conflicts of original PR
- Tests failed at OptionalArgs.mls
fun f1(a: Int, b: Int) = a + b
//│ ╔══[ERROR] Type mismatch in operator application:
//│ ║ l.17: fun f1(a: Int, b: Int) = a + b
//│ ║ ^^^^^
//│ ╟── type `()` is not an instance of type `Int`
//│ ║ l.17: fun f1(a: Int, b: Int) = a + b
//│ ║ ^^^
//│ ╟── but it flows into reference with expected type `Int`
//│ ║ l.17: fun f1(a: Int, b: Int) = a + b
//│ ╙── ^
//│ TEST CASE FAILURE: There was an unexpected type error
//│ fun f1: (a: Int | (), b: Int | ()) -> (Int | error)