Summary: opAssign signature rules not enforced on templated
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from Lars T. Kyllingstad <> 2010-04-19 
00:59:09 PDT ---
The "Operator Overloading" page of the spec says that:

   "...the following parameter signatures for opAssign
    are not allowed:
    where T is the same type as the aggregate type A..."

However, the following compiles:

    import std.stdio;

    struct S
        S opAssign(T)(T t)
            return this;

    void main()
        S a, b;
        a = b;

When run, it prints 'S'.

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

Reply via email to