[Issue 7359] New: Template function with typesafe variadic rejects more than one string arguments

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jan 24 04:54:13 PST 2012


http://d.puremagic.com/issues/show_bug.cgi?id=7359

           Summary: Template function with typesafe variadic rejects more
                    than one string arguments
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: k.hara.pg at gmail.com


--- Comment #0 from Kenji Hara <k.hara.pg at gmail.com> 2012-01-24 04:54:11 PST ---
bool foo(T)(T[] a ...) {
  return true;
}

void main() {
  assert(foo(1,1,1,1,1,1));               // OK
  assert(foo("abc"));                     // OK, T == immutable(char)
  assert(foo("abc","abc","abc","abc"));   // NG, T should be deduced to string
}

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


More information about the Digitalmars-d-bugs mailing list