Bug 9654 – Template function cannot take string by ref T[len]

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-03-05T20:46:00Z
Last change time
2013-03-15T09:58:40Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
k.hara.pg

Comments

Comment #0 by k.hara.pg — 2013-03-05T20:46:45Z
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 }
Comment #1 by k.hara.pg — 2013-03-05T20:51:06Z
Comment #2 by github-bugzilla — 2013-03-05T22:43:49Z
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]
Comment #3 by github-bugzilla — 2013-03-15T09:58:40Z
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.