Improve error message for invalid argument types
Nobody has claimed this yet.
- Dominant language
- Dart
- Stars
- 13
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
Currently, when a function call has invalid arguments, the error is emitted in relation to the entire argument struct.
Example:
```
let printMessage (:message String) = print message
let main () = printMessage (:message 10)
// ^^^^^^^^^^^^^ invalid_argument_type
```
For single arguments functions this is not a big problem, but when one of the arguments match while the others don't, it may be confusing.
Example
```
let printUser (:name String, :age int) = print name
// The error is emitted to the entire struct, but only
// the age is invalid.
let main () = printMessage (:name "Joe", :age "10")
// ^^^^^^^^^^^^^^^^^^^^^^^^ invalid_argument_type
```
We should distinguish every problem with the passed argument and give more specific error messages.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No source file, test, or entry point is named in the issue. Locate the argument type-validation and diagnostic code, then inspect how mixed valid and invalid arguments are reported. Done means each invalid argument is identified separately with a more specific error message.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100