D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 6378 - Overriding opAssign disables ability to null a reference
Summary: Overriding opAssign disables ability to null a reference
Status: RESOLVED DUPLICATE of issue 6630
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: Other Windows
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-25 07:35 UTC by Andrej Mitrovic
Modified: 2011-10-04 13:22 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Andrej Mitrovic 2011-07-25 07:35:28 UTC
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 Kenji Hara 2011-10-04 13:22:11 UTC

*** This issue has been marked as a duplicate of issue 6630 ***