Skip to content

Commit

Permalink
Fix Issue 22695 - std.traits.isBuiltinType is false for typeof(null)
Browse files Browse the repository at this point in the history
  • Loading branch information
wolframw committed Jan 24, 2022
1 parent 30de0aa commit 00449e2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion std/traits.d
Original file line number Diff line number Diff line change
Expand Up @@ -6095,7 +6095,7 @@ template BuiltinTypeOf(T)
alias X = OriginalType!T;
static if (__traits(isArithmetic, X) && !is(X == __vector) ||
__traits(isStaticArray, X) || is(X == E[], E) ||
__traits(isAssociativeArray, X))
__traits(isAssociativeArray, X) || is(X == typeof(null)))
alias BuiltinTypeOf = X;
else
static assert(0);
Expand Down Expand Up @@ -7037,6 +7037,7 @@ enum bool isBuiltinType(T) = is(BuiltinTypeOf!T) && !isAggregateType!T;
static assert( isBuiltinType!string);
static assert( isBuiltinType!(int[]));
static assert( isBuiltinType!(C[string]));
static assert( isBuiltinType!(typeof(null)));
static assert(!isBuiltinType!C);
static assert(!isBuiltinType!U);
static assert(!isBuiltinType!S);
Expand Down

0 comments on commit 00449e2

Please sign in to comment.