Example D2 code to generate the error together with what causes it.
text/x-dsrc
395
Comments
Comment #0 by dy70swq+kzut3k — 2014-02-09T11:58:18Z
Created attachment 1323
Example D2 code to generate the error together with what causes it.
When foo function is used, compile time error is seen.
bugtesr.d(16): Error: template bugtesr.Test.foo does not match any function
template declaration. Candidates are:
bugtesr.d(4): bugtesr.Test.foo(T)(in T[Test.DATA_LENGTH] msg) if (is(T :
ubyte) || is(T : char))
bugtesr.d(16): Error: template bugtesr.Test.foo(T)(in T[Test.DATA_LENGTH] msg)
if (is(T : ubyte) || is(T : char)) cannot deduce template function from
argument types !()(ubyte[16])
If the constant DATA_LENGTH is replaced with its real value 16, it works
without a problem.
Comment #1 by bearophile_hugs — 2014-02-09T12:27:46Z
Comment #4 by andrej.mitrovich — 2014-02-16T14:28:40Z
P.S. Kenji sorry for not closing these myself, when I set to auto-merge I tend to do some other work and I miss the notification so the issue can be closed.
I guess we could use some kind of auto-close feature as well.