You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently due to how currying and named arguments passing works in Enso, when a function is called with a named argument that is misspelled, and the needed argument is optional (has a default value), the user will see:
Type error: expected a function but got [Some value]
That is because the interpreter is trying to apply more arguments, filling in unmatched arguments with default values when available, hoping that the returned value might be a function that will take the matching argument name. But most of the time the result is not a new function but some value.
If the arguments are not all optional, then at least we get a not-fully applied function with oversaturated argument, e.g.:
f.f[file.enso:3-4] self=f a=_ b=_ +d=4
The goal of this ticket is to improve the first case and give the user more information on the Type error.
The text was updated successfully, but these errors were encountered:
The idea is to catch the place where the argument becomes oversaturated and if the later execution is to cause a type error AND that oversaturated argument was named, to add additional information to the error:
The named argument `d` did not match any argument names. Perhaps it is misspelled?
Radosław Waśko reports a new STANDUP for yesterday (2025-02-19):
Progress: Continuing investigating the benchmarks, after all it seems the results are acceptable - will merge the error handling PR. Some work on adapting the Linter but not yet finished. Meetings, reviews. It should be finished by 2025-02-19.
Next Day: Next day I will be working on the #12334 task. Finish changes to the Linter, do some Type inference work.
Followup of #7359.
Currently due to how currying and named arguments passing works in Enso, when a function is called with a named argument that is misspelled, and the needed argument is optional (has a default value), the user will see:
That is because the interpreter is trying to apply more arguments, filling in unmatched arguments with default values when available, hoping that the returned value might be a function that will take the matching argument name. But most of the time the result is not a new function but some value.
If the arguments are not all optional, then at least we get a not-fully applied function with oversaturated argument, e.g.:
The goal of this ticket is to improve the first case and give the user more information on the
Type error
.The text was updated successfully, but these errors were encountered: