Skip to content

Commit

Permalink
Fix internal template GetOverloadedMethods - should see overload first
Browse files Browse the repository at this point in the history
  • Loading branch information
9rnsr committed Jun 3, 2013
1 parent b06fe4b commit f52b88c
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions std/typecons.d
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

0 comments on commit f52b88c

Please sign in to comment.