diff --git a/changelog/PR8838.dd b/changelog/PR8838.dd deleted file mode 100644 index 4672d9ee8..000000000 --- a/changelog/PR8838.dd +++ /dev/null @@ -1,10 +0,0 @@ -isBasicType!T now returns false for enum types - -In the language spec, a basic type is defined to be one of `void`, `bool`, a -built-in integer type, a built-in character type, or a built-in floating-point -type. - -Prior to this release, `isBasicType!T` returned `true` when `T` was either a -basic type, or an `enum` type whose base type was a basic type. Now, it returns -`false` for all `enum` types, and only returns `true` if `T` itself is a basic -type. diff --git a/std/traits.d b/std/traits.d index cc49d76b2..2e7a4f6a3 100644 --- a/std/traits.d +++ b/std/traits.d @@ -6480,8 +6480,7 @@ enum bool isScalarType(T) = __traits(isScalar, T) && is(T : real); /** * Detect whether `T` is a basic type (scalar type or void). */ -enum bool isBasicType(T) = - !is(T == enum) && (isScalarType!T || is(immutable T == immutable void)); +enum bool isBasicType(T) = isScalarType!T || is(immutable T == immutable void); /// @safe unittest @@ -6501,13 +6500,6 @@ enum bool isBasicType(T) = static assert(isBasicType!(const(dchar))); } -// https://issues.dlang.org/show_bug.cgi?id=24215 -@safe unittest -{ - enum E : int { a } - static assert(!isBasicType!E); -} - /** * Detect whether `T` is a built-in unsigned numeric type. */