Integer conversions too pedantic in 64-bit

Daniel Gibson metalcaedes at gmail.com
Tue Feb 15 13:29:08 PST 2011


Am 15.02.2011 19:10, schrieb bearophile:
> Daniel Gibson:
> 
>> void main() {
>>    size_t x;
>>    writefln(typeof(x).stringof);
>> }
>> try this, too ;-)
>>
>> Because it's an alias the information about size_t gone at runtime and 
>> the "real" type is shown. uint in your case. (Here - gdc on amd64 - it's 
>> ulong).
> 
> I think both typeof() and stringof are compile-time things.
> 
> And regarding lost alias information I suggest to do as Clang does:
> http://d.puremagic.com/issues/show_bug.cgi?id=5004
> 
> Bye,
> bearophile

Hmm yeah, you're probably right. After sending my reply I thought about that myself.
However: At the time typeof() is handled by the compiler the aliases are already
resolved.

I agree that "aka" for alias information in error-messages would be helpful in
general, but this wouldn't help here.



More information about the Digitalmars-d mailing list