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

Diego Canuhé canuhedc at gmail.com
Thu Jul 28 03:04:19 PDT 2011


thanks, I was looking at this the wrong way


On Tue, Jul 26, 2011 at 9:54 AM, Steven Schveighoffer
<schveiguy at yahoo.com>wrote:

> On Tue, 26 Jul 2011 07:54:54 -0400, Diego Canuhé <canuhedc at gmail.com>
> wrote:
>
>  Hi,
>> isn't that the way it's supposed to work? I mean
>>
>> void show(int a) { writeln(a); }
>>
>> void main() { show(null); }
>>
>> won't compile either.
>> Shouldn't bar be some kind of pointer?
>>
>
> null should be considered as the type of the class, not void *.  You should
> not be able to override the behavior of opAssign as it pertains to assigning
> to a class instance.  In other words, you should *never* be able to override
> x = null where x is a class instance.
>
>
>
>> btw, today I read "opAssign can no longer be overloaded for class objects"
>> here:
>>
>> http://www.d-programming-**language.org/features2.html<http://www.d-programming-language.org/features2.html>
>>
>> is that no longer valid?
>>
>
> Here is the spec.  I would not trust that features2, it's probably out of
> date.
>
> http://www.d-programming-**language.org/**operatoroverloading.html#**
> Assignment<http://www.d-programming-language.org/operatoroverloading.html#Assignment>
>
> -Steve
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20110728/208107d8/attachment-0001.html>


More information about the Digitalmars-d-learn mailing list