[Issue 7090] New: Value parameter types not respected in templates

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Dec 10 11:05:04 PST 2011


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

           Summary: Value parameter types not respected in templates
           Product: D
           Version: unspecified
          Platform: Other
        OS/Version: Mac OS X
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: andrei at metalanguage.com


--- Comment #0 from Andrei Alexandrescu <andrei at metalanguage.com> 2011-12-10 11:05:03 PST ---
This code fails to compile:

struct A(size_t N) {}
void main() {
    A!(1) a1;
    A!(cast(size_t) 1) a2;
    assert(a1 == a2);
}

with the message:

./test.d(10): Error: incompatible types for ((a1) == (a2)): 'A!(1)' and
'A!(1u)'

This is mistaken. The type of N is not decided by the instantiation, but by A.

-- 
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