[Issue 12988] New: Diagnostic for wrong 'this' prefix when matching parameter is found should improve
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Wed Jun 25 04:43:51 PDT 2014
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: nobody at puremagic.com
Reporter: andrej.mitrovich at gmail.com
-----
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'?
--
More information about the Digitalmars-d-bugs
mailing list