[Issue 24215] New: std.traits.isBasicType!Enum returns true
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Nov 1 19:41:27 UTC 2023
https://issues.dlang.org/show_bug.cgi?id=24215
Issue ID: 24215
Summary: std.traits.isBasicType!Enum returns true
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: phobos
Assignee: nobody at puremagic.com
Reporter: snarwin+bugzilla at gmail.com
As of DMD+Phobos 2.105.2, the following program fails to compile:
---
import std.traits;
enum E { a }
static assert(!isBasicType!E);
---
According to the language spec [1], the basic types consist of `void`, `bool`,
the built-in integer types, the built-in floating-point types, and the built-in
character types. Enum types are not included.
std.traits.isBasicType should follow with the language spec, and return `false`
for enum types.
[1] https://dlang.org/spec/type.html#basic-data-types
--
More information about the Digitalmars-d-bugs
mailing list