Merge pull request #8841 from pbackus/revert-isbasictype-changes

Revert "Fix Issue 24215 - isBasicType!Enum should be false"
This commit is contained in:
Dennis 2023-11-06 12:00:32 +01:00 committed by GitHub
commit ebf5038fbf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 19 deletions

View file

@ -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.

View file

@ -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.
*/