Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 4 additions & 14 deletions std/datetime.d
Original file line number Diff line number Diff line change
Expand Up @@ -25824,9 +25824,7 @@ static TP delegate(in TP) everyDayOfWeek(TP, Direction dir = Direction.fwd)(DayO
(dir == Direction.fwd || dir == Direction.bwd) &&
__traits(hasMember, TP, "dayOfWeek") &&
!__traits(isStaticFunction, TP.dayOfWeek) &&
is(ReturnType!(TP.dayOfWeek) == DayOfWeek) &&
(functionAttributes!(TP.dayOfWeek) & FunctionAttribute.property) &&
(functionAttributes!(TP.dayOfWeek) & FunctionAttribute.nothrow_))
is(typeof(TP.dayOfWeek) == DayOfWeek))
{
TP func(in TP tp)
{
Expand Down Expand Up @@ -25958,9 +25956,7 @@ static TP delegate(in TP) everyMonth(TP, Direction dir = Direction.fwd)(int mont
(dir == Direction.fwd || dir == Direction.bwd) &&
__traits(hasMember, TP, "month") &&
!__traits(isStaticFunction, TP.month) &&
is(ReturnType!(TP.month) == Month) &&
(functionAttributes!(TP.month) & FunctionAttribute.property) &&
(functionAttributes!(TP.month) & FunctionAttribute.nothrow_))
is(typeof(TP.month) == Month))
{
enforceValid!"months"(month);

Expand Down Expand Up @@ -33028,10 +33024,7 @@ template hasMin(T)
{
enum hasMin = __traits(hasMember, T, "min") &&
__traits(isStaticFunction, T.min) &&
is(ReturnType!(T.min) == Unqual!T) &&
(functionAttributes!(T.min) & FunctionAttribute.property) &&
(functionAttributes!(T.min) & FunctionAttribute.nothrow_);
//(functionAttributes!(T.min) & FunctionAttribute.pure_); //Ideally this would be the case, but SysTime's min() can't currently be pure.
is(typeof(T.min) == Unqual!T);
}

unittest
Expand Down Expand Up @@ -33061,10 +33054,7 @@ template hasMax(T)
{
enum hasMax = __traits(hasMember, T, "max") &&
__traits(isStaticFunction, T.max) &&
is(ReturnType!(T.max) == Unqual!T) &&
(functionAttributes!(T.max) & FunctionAttribute.property) &&
(functionAttributes!(T.max) & FunctionAttribute.nothrow_);
//(functionAttributes!(T.max) & FunctionAttribute.pure_); //Ideally this would be the case, but SysTime's max() can't currently be pure.
is(typeof(T.max) == Unqual!T);
}

unittest
Expand Down
19 changes: 11 additions & 8 deletions std/typecons.d
Original file line number Diff line number Diff line change
Expand Up @@ -2974,21 +2974,24 @@ private template GetOverloadedMethods(T)
{
alias follows = TypeTuple!();
}
else static if (allMembers[i] == "this")
{
alias follows = follows!(i + 1);
}
else
{
enum name = allMembers[i];

template isFunction(T, string name)
template isMethod(alias f)
{
static if (is(typeof(mixin("&T."~name)) F == F*) && is(F == function))
enum isFunction = true;
static if (is(typeof(&f) F == F*) && is(F == function))
enum isMethod = !__traits(isStaticFunction, f);
else
enum isFunction = false;
enum isMethod = false;
}
static if (isFunction!(T, name) && !__traits(isStaticFunction, mixin("T."~name)))
alias follows = TypeTuple!(__traits(getOverloads, T, name), follows!(i + 1));
else
alias follows = follows!(i + 1);
alias follows = TypeTuple!(
std.typetuple.Filter!(isMethod, __traits(getOverloads, T, name)),
follows!(i + 1));
}
}
alias GetOverloadedMethods = follows!();
Expand Down