[Issue 12122] New: Template with enumerated constant length array causes error.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Feb 9 11:58:21 PST 2014


https://d.puremagic.com/issues/show_bug.cgi?id=12122

           Summary: Template with enumerated constant length array causes
                    error.
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: dy70swq+kzut3k at sharklasers.com


--- Comment #0 from tcak <dy70swq+kzut3k at sharklasers.com> 2014-02-09 11:58:18 PST ---
Created an attachment (id=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.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list