new static if bug Re: DMD 1.032 and 2.016 releases
Don
nospam at nospam.com.au
Thu Jul 10 00:06:22 PDT 2008
bearophile wrote:
> Walter Bright Wrote:
>> It's not a bug. typeof(X), where X is a type, is not valid D and never
>> was. It was a quirk in the compiler (and a bugzilla bug report) that it
>> ever accepted it.
>
> I did assume that typeof(x) == typeof(typeof(x)) for any x (value or type) (but it seems that semantic of mine was wrong).
Yup, a lot of us did that. Because it worked most of the time, except
that atomic types didn't work (such as typeof(int)).
Fortunately, the fix is easy -- I think typeof(x.init) will always work.
More information about the Digitalmars-d-announce
mailing list