Description
Discovered in the wild a number of cases like this:
typedef A(B);
typedef B(dynamic);
Both of them are essentially equivalent to dynamic->dynamic
which is most likely not what the user has in mind. Instead, they likely mean:
typedef A(B _);
typedef B(dynamic _);
As Paul Berry points out it's a nasty user trap in the language, especially for people coming from a C/C++ background where using a single identifier as a formal parameter denotes the type of the formal parameter. A proposed lint:
whenever a single identifier is used to name a formal parameter, check the enclosing scope to see if
the name shadows a type. If it does, give a hint because the user probably meant the identifier to
denote the type of the formal parameter. We could even add a quick fix which adds "_" as the
parameter name.