Open
Description
There are already custom error messages to help make the problem more clear for a lot of cases but overall the messages could be improved.
Example:
void gFn<T>() => print(T);
main() {
dynamic d = gFn<int>;
d<String>();
}
Error:
NoSuchMethodError: 'result'
Dynamic call with unexpected type arguments. Expected: 0 Actual: 1
Receiver: Instance of '() => void'
Arguments: []
One possibility would be to use a pattern more like the VM has now where it shows the attempted call with args and they type of the value being invoked. Some areas for improvement in the wording:
- instance vs static class members
- setters vs getters vs methods
- tearoff closures vs null values vs methods
- arguments passed vs expected
- type arguments passed vs expected
- correct names where applicable
Related: #49628