How do I call super or object.opAssign for classes?

Andrej Mitrovic andrej.mitrovich at gmail.com
Mon Jul 25 07:35:49 PDT 2011


http://d.puremagic.com/issues/show_bug.cgi?id=6378

On 7/25/11, Steven Schveighoffer <schveiguy at yahoo.com> wrote:
> On Sat, 23 Jul 2011 12:23:07 -0400, Andrej Mitrovic
> <andrej.mitrovich at gmail.com> wrote:
>
>> class Foo
>> {
>>     void opAssign(int bar)
>>     {
>>     }
>> }
>>
>> void main()
>> {
>>     auto foo = new Foo;
>>     foo = null;
>> }
>>
>> test.d(17): Error: function test.Foo.opAssign (int bar) is not
>> callable using argument types (void*)
>> test.d(17): Error: cannot implicitly convert expression (null) of type
>> void* to int
>>
>> I just wanted to implement one opAssign method for assigning a
>> specific type, but now I've ran into the issue that assigning class
>> objects to null doesn't work anymore.. :/
>
> That's a bug, please file.
>
> -Steve
>


More information about the Digitalmars-d-learn mailing list