www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 7090] New: Value parameter types not respected in templates

reply d-bugmail puremagic.com writes:
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 puremagic.com
        ReportedBy: andrei metalanguage.com



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: -------
Dec 10 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7090


Trass3r <mrmocool gmx.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mrmocool gmx.de



Same as http://d.puremagic.com/issues/show_bug.cgi?id=2550?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 10 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7090


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE



Yes, this is same as 2550.

And I've posted a pull for fix this.
https://github.com/D-Programming-Language/dmd/pull/449
I've checked that the patch surely fixes this issue in my local.

But it is not yet merged with Walter's disagreement.

*** This issue has been marked as a duplicate of issue 2550 ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 10 2011
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7090




13:31:32 PST ---
Kenji: Walter agreed to take a second look at your pull request. Thanks again
for all your incredible work.

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