Permalink
Browse files

fix Issue 9259 - Passing an array of pointers to a typesafe vararg is…

… broken
  • Loading branch information...
9rnsr committed Jan 10, 2013
1 parent bc8b981 commit 066b2801e06867d1d147be9629328a37b525bb57
Showing with 14 additions and 1 deletion.
  1. +1 −1 src/mtype.c
  2. +13 −0 test/runnable/test9259.d
View
@@ -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)
View
@@ -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.