Skip to content
Browse files

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

… broken
  • Loading branch information...
1 parent bc8b981 commit 066b2801e06867d1d147be9629328a37b525bb57 @9rnsr 9rnsr committed
Showing with 14 additions and 1 deletion.
  1. +1 −1 src/mtype.c
  2. +13 −0 test/runnable/test9259.d
View
2 src/mtype.c
@@ -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
13 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.
Something went wrong with that request. Please try again.