[Issue 11554] New: `is(T == enum); ` produces an error if T is an enum defined with no members
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Nov 19 09:31:14 PST 2013
https://d.puremagic.com/issues/show_bug.cgi?id=11554
Summary: `is(T == enum);` produces an error if T is an enum
defined with no members
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: regression
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: blah38621 at gmail.com
--- Comment #0 from Orvid King <blah38621 at gmail.com> 2013-11-19 09:31:10 PST ---
The following code now produces an error, when it previously produced no error.
The error can be eliminated by adding a member to the enum, but that's not how
every enum that I've seen that's intended as a UDA is declared.
enum isEnum(T) = is(T == enum);
@safe pure nothrow unittest
{
enum AnEnum;
static assert(isEnum!AnEnum, "Failed to determine that AnEnum is an
enum!");
}
And now the error:
std/traitsExt.d(43): Error: enum std.traitsExt.__unittestL44_9.AnEnum is
forward referenced looking for base type.
As far as I can tell, it was caused by the commit merged in
https://github.com/D-Programming-Language/dmd/pull/2795. However, without some
fun with git I can't be certain, but it's the only commit dealing with enums in
the last 2 days, before which this code compiled without error.
--
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list