Bug 24215 – std.traits.isBasicType!Enum should be false
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2023-11-01T19:41:27Z
Last change time
2023-11-06T11:00:49Z
Keywords
pull
Assigned to
No Owner
Creator
Paul Backus
Comments
Comment #0 by snarwin+bugzilla — 2023-11-01T19:41:27Z
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
Comment #1 by dlang-bot — 2023-11-01T20:02:54Z
@pbackus created dlang/phobos pull request #8838 "Fix Issue 24215 - isBasicType!Enum should be false" fixing this issue:
- Fix Issue 24215 - isBasicType!Enum should be false
https://github.com/dlang/phobos/pull/8838
Comment #2 by dlang-bot — 2023-11-02T15:23:54Z
dlang/phobos pull request #8838 "Fix Issue 24215 - isBasicType!Enum should be false" was merged into master:
- 0478a6caf8cda723b154150ac2ae6efa80c6aaaf by Paul Backus:
Fix Issue 24215 - isBasicType!Enum should be false
https://github.com/dlang/phobos/pull/8838
Comment #3 by dlang-bot — 2023-11-06T11:00:49Z
dlang/phobos pull request #8841 "Revert "Fix Issue 24215 - isBasicType!Enum should be false"" was merged into master:
- fa0307e09155b414c4718ea62557024d09b349af by Paul Backus:
Revert "Fix Issue 24215 - isBasicType!Enum should be false"
This reverts commit 98326c477f0f9555ca6ed3671fa4359a680e4c31.
https://github.com/dlang/phobos/pull/8841