www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 22057] New: [Reg 2.074] std.traits.isNumeric & isUnsigned

https://issues.dlang.org/show_bug.cgi?id=22057

          Issue ID: 22057
           Summary: [Reg 2.074] std.traits.isNumeric & isUnsigned should
                    not be true for enum types with character base types
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: n8sh.secondary hotmail.com

Below code fails from 2.074 onward:

---
import std.traits;

enum EChar : char { a = 0, }
static assert(!isNumeric!EChar);
static assert(!isUnsigned!EChar);
---

Note that in 2.074 isIntegral remained false for enums with character base
types, creating an inconsistency.

--
Jun 21