Summary: Ambiguous alias this accepted.
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Keywords: accepts-invalid
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from Bernard Helyer <> 2011-04-17 
06:55:06 PDT ---
import std.stdio;

class Foo
    this() { o = new Object(); }
    Object o;
    alias o this;

    override string toString()
        return "Foo";

void foo(Object o)

void main()
    foo(new Foo());

The code compiles, and prints "Foo". After discussing with Andrei, I believe
this code is an error.

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

Reply via email to