Hacker News new | ask | show | jobs
by Dylan16807 698 days ago
If the type is `type`, and you're missing one argument, and the types of the arguments suggest you're missing the first argument, then that's an opportunity for a much more specific error message.

But before we even get to that stage, I would prefer that "." isn't the syntax for both types of call.

1 comments

Agreed on both counts. We give C++ a lot of flack for verbose syntax, but separating scope resolution (::) from member access (.) is something that it got right, not a place to cut.

They're semantically similar, but not the same, which is actually exactly the place where you should distinguish syntax. Using parentheses for both expression grouping and function calls doesn't hurt readability much, but using them for both function calls and array access would. This falls more in the latter category.