Summary: Catch wrong argument<->attribute assignments in
           Product: D
           Version: D1 & D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: diagnostic
          Severity: enhancement
          Priority: P2
         Component: DMD

--- Comment #0 from 2010-06-29 18:15:53 PDT ---
This is related to bug 3878 , but it is meant to catch a different kind of bug.
In my code I have seen two times bugs like:

class Foo {
    int x, y;
    this(int x_, int y_) {
        this.x = x;
        y = y;

void main() {}

In D.learn Byron Heads has found this bug:

this(string name, string id) {
    this._name = _name;
    this._id  = id;

So I think the D compiler has to catch such bugs, and refuse such assignments
in class/struct member functions.

Automatic code generation can sometimes generate useless assignments, but
catching common human bugs is more important. It's much simpler to fix code
generators than humans.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to