Skip to content

Commit

Permalink
fix Issue 17495 - __traits(getParameterStorageClasses) doesn't work w…
Browse files Browse the repository at this point in the history
…ith tuples as parameters
  • Loading branch information
WalterBright committed Jun 12, 2017
1 parent cb54f4c commit bb9d0d0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ddmd/traits.d
Expand Up @@ -1021,9 +1021,9 @@ extern (C++) Expression semanticTraits(TraitsExp e, Scope* sc)
}
ex = ex.ctfeInterpret();
auto ii = ex.toUInteger();
if (ii >= fparams.dim)
if (ii >= Parameter.dim(fparams))
{
e.error("parameter index must be in range 0..%u not %s", cast(uint)fparams.dim, ex.toChars());
e.error("parameter index must be in range 0..%u not %s", cast(uint)Parameter.dim(fparams), ex.toChars());
return new ErrorExp();
}

Expand Down
13 changes: 13 additions & 0 deletions test/runnable/traits.d
Expand Up @@ -1514,6 +1514,19 @@ void test12237()

/********************************************************/

void async(ARGS...)(ARGS)
{
static void compute(ARGS)
{
}

auto x = __traits(getParameterStorageClasses, compute, 1);
}

alias test17495 = async!(int, int);

/********************************************************/

int main()
{
test1();
Expand Down

0 comments on commit bb9d0d0

Please sign in to comment.