http://d.puremagic.com/issues/show_bug.cgi?id=4103
Summary: opAssign signature rules not enforced on templated opAssign Product: D Version: unspecified Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: bugzi...@kyllingen.net --- Comment #0 from Lars T. Kyllingstad <bugzi...@kyllingen.net> 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: ... opAssign(T) ... 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) { writeln(T.stringof); return this; } } void main() { S a, b; a = b; } When run, it prints 'S'. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------