typeof(typename) fails silently

BCS ao at pathlink.com
Mon Sep 15 17:42:12 PDT 2008


Reply to Jarrett,

> On Mon, Sep 15, 2008 at 7:08 PM, Sean Kelly <sean at invisibleduck.org>
> wrote:
> 
>> Code like the following:
>> 
>> static if(is(typeof(int))) { pragma(msg, "hi"); }
>> 
>> used to work just fine (ie. it used to print "hi") even though typeof
>> was being used to evaluate a type.  Now apparently the same tests
>> fail, but they do so silently.  If typeof isn't supposed to be used
>> to evaluate types, could we _please_ get a compile error about this?
>> I've just discovered that a bunch of Tango code silently stopped
>> working when this change was implemented and it would have been great
>> if the build had simply failed on what is now apparently an illegal
>> operation.
>> 
>> Sean
>> 
> Oh but Sean, anything illegal inside an is() expression doesn't give
> an error!
> 
> FUN.
> 

That includes things like import("file") can't find the file 

Real fun!




More information about the Digitalmars-d-bugs mailing list