Skip to content

Commit

Permalink
Merge pull request #1354 from 9rnsr/fix9090
Browse files Browse the repository at this point in the history
Issue 9090 - auto ref doesn't work with arrays
  • Loading branch information
WalterBright committed Dec 8, 2012
2 parents 3dff765 + 03e88e1 commit 3302a4b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/cast.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Expression *Expression::implicitCastTo(Scope *sc, Type *t)
}
#endif
#if DMDV2
if (match == MATCHconst && t == type->constOf())
if (match == MATCHconst && type->constConv(t))
{
Expression *e = copy();
e->type = t;
Expand Down
12 changes: 12 additions & 0 deletions test/runnable/testconst.d
Original file line number Diff line number Diff line change
Expand Up @@ -2872,6 +2872,17 @@ void test9046()
}
}

/************************************/
// 9090

void test9090()
{
void test1(T)(auto ref const T[] val) {}

string a;
test1(a);
}

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

int main()
Expand Down Expand Up @@ -2993,6 +3004,7 @@ int main()
test8408();
test8688();
test9046();
test9090();

printf("Success\n");
return 0;
Expand Down

0 comments on commit 3302a4b

Please sign in to comment.