mirror of
https://github.com/dlang/phobos.git
synced 2025-04-28 06:00:35 +03:00
Merge pull request #8841 from pbackus/revert-isbasictype-changes
Revert "Fix Issue 24215 - isBasicType!Enum should be false"
This commit is contained in:
commit
ebf5038fbf
2 changed files with 1 additions and 19 deletions
|
@ -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.
|
10
std/traits.d
10
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.
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue