https://issues.dlang.org/show_bug.cgi?id=12988
Issue ID: 12988
Summary: Diagnostic for wrong 'this' prefix when matching
parameter is found should improve
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Keywords: diagnostic
Severity: enhancement
Priority: P1
Component: DMD
Assignee: [email protected]
Reporter: [email protected]
-----
class F
{
void test(string str)
{
this.str = "";
}
}
void main()
{
}
-----
$ dmd test.d
> test.d(5): Error: no property 'str' for type 'test.F'
The compiler should try to detect whether 'str' is also a parameter name, and
in this case emit something like:
$ dmd test.d
> test.d(5): Error: no property 'str' for type 'test.F', did you mean parameter
> 'str'?
--