Bug 6378 – Overriding opAssign disables ability to null a reference
Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2011-07-25T07:35:00Z
Last change time
2011-10-04T13:22:11Z
Assigned to
nobody
Creator
andrej.mitrovich
Comments
Comment #0 by andrej.mitrovich — 2011-07-25T07:35:28Z
class Foo
{
void opAssign(int bar)
{
}
}
void main()
{
auto foo = new Foo;
foo = null;
}
test.d(11): Error: function test.Foo.opAssign (int bar) is not callable using argument types (void*)
test.d(11): Error: cannot implicitly convert expression (null) of type void* to int
Comment #1 by k.hara.pg — 2011-10-04T13:22:11Z
*** This issue has been marked as a duplicate of issue 6630 ***