Improve error when missing a comma in Apply args #18734
Labels
area:parser
area:reporting
Error reporting including formatting, implicit suggestions, etc
better-errors
Issues concerned with improving confusing/unhelpful diagnostic messages
itype:enhancement
Compiler version
3.3.1
Minimized example
Output Error/Warning message
When using named arguments the error is even more confusing:
Why this Error/Warning was not helpful
Following the compiler suggestion and adding a
)
would just lead to another compile error, as it is expecting more arguments. It's much more likely that a,
is missing.For named arguments the first error is similar to the first when not using named arguments, but the second one is more confusing, as the suggestion of a
;
does not work, nor does adding an empty line (it is already there!)Suggested improvement
Something similar to what TypeScript does:
Error:
This should also work for named arguments:
The text was updated successfully, but these errors were encountered: