December 08, 2007 [Issue 1717] New: Template class with opAssign should be nullable | ||||
---|---|---|---|---|
| ||||
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. -- |
January 18, 2008 [Issue 1717] Template class with opAssign should be nullable | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | 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. -- |
Copyright © 1999-2021 by the D Language Foundation