digitalmars.D.bugs - [Issue 1717] New: Template class with opAssign should be nullable
- d-bugmail puremagic.com (25/25) Dec 07 2007 http://d.puremagic.com/issues/show_bug.cgi?id=1717
- d-bugmail puremagic.com (9/9) Jan 18 2008 http://d.puremagic.com/issues/show_bug.cgi?id=1717
http://d.puremagic.com/issues/show_bug.cgi?id=1717 Summary: Template class with opAssign should be nullable Product: D Version: 1.023 Platform: PC OS/Version: Windows Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: bugzilla digitalmars.com ReportedBy: vertex gmx.at class Foo(T) { T opAssign(T v) { return v; } } void main() { auto foo = new Foo!(float)(); foo = cast(Foo!(float))null; // Works foo = null; // Error: Can't convert null to float } DMD should not try to implicitly cast null to template type, but set the reference to null instead. --
Dec 07 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1717 bugzilla digitalmars.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |WONTFIX ------- Comment #1 from bugzilla digitalmars.com 2008-01-18 12:21 ------- This is (one reason) why opAssign for classes is getting dropped in D 2.0. --
Jan 18 2008