[Issue 8339] is(typeof(...)) is reporting true when it's false due to nested function error

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jul 16 07:13:20 PDT 2012


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



--- Comment #3 from Don <clugdbug at yahoo.com.au> 2012-07-16 07:13:18 PDT ---
(In reply to comment #2)
> We use is(typeof(exp)) to check for compilability all over the place. Are you
> saying that we should be using __traits(compiles, exp) instead?

Probably. Mostly is(typeof()) does what you want, but just be aware that it's a
trick. It's just checking for existence of a type, not for compilability.
It's widespread because it works for D1, which doesn't have __traits.

It's also rather better tested than __traits...

> Using __traits(compiles, {R range;}) still fails here. But should it work as
> I'm trying to do here if the glue layer issues is fixed?

Yes, it should work.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list