Skip to content

Commit

Permalink
fix Issue 9259 - Passing an array of pointers to a typesafe vararg is…
Browse files Browse the repository at this point in the history
… broken
  • Loading branch information
9rnsr committed Jan 10, 2013
1 parent bc8b981 commit 066b280
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/mtype.c
Expand Up @@ -4311,7 +4311,7 @@ MATCH TypeDArray::implicitConvTo(Type *to)
return MATCHconvert;
}

return next->constConv(to);
return next->constConv(to) ? MATCHconvert : MATCHnomatch;
}

if (to->ty == Tarray)
Expand Down
13 changes: 13 additions & 0 deletions test/runnable/test9259.d
@@ -0,0 +1,13 @@
// PERMUTE_ARGS: -inline -release -g -O -d -dw -de

void test(int*[] arr...)
{
assert(arr.length == 1);
assert(*arr[0] == 5); // This assertion fails
}

void main()
{
int a = 5;
test([&a]);
}

0 comments on commit 066b280

Please sign in to comment.