This code should work. void foo(ref const char[8] str) {} void bar(T)(ref const T[8] str) {} void main() { foo("testinfo"); // OK bar("testinfo"); // should be OK, but fails }
https://github.com/D-Programming-Language/dmd/pull/1723
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/a9c17e46e968e45c2ed329b658e714659362cae5 fix Issue 9654 - Template function cannot take string by ref T[len] https://github.com/D-Programming-Language/dmd/commit/fb5f3fb7c9f8cf60c6495bd9df4103e80553e588 Merge pull request #1723 from 9rnsr/fix9654 Issue 9654 - Template function cannot take string by ref T[len]
Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/c0c678e73a088482da91b6e05c1ec91788461273 fix Issue 9654 - Template function cannot take string by ref T[len] That should work even if len is TemplateValueParameter.