Bug 7090 – Value parameter types not respected in templates

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Mac OS X
Creation time
2011-12-10T11:05:00Z
Last change time
2015-06-09T05:14:49Z
Assigned to
nobody
Creator
andrei

Comments

Comment #0 by andrei — 2011-12-10T11:05:03Z
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.
Comment #1 by hoganmeier — 2011-12-10T11:44:25Z
Comment #2 by k.hara.pg — 2011-12-10T12:08:27Z
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 ***
Comment #3 by andrei — 2011-12-10T13:31:32Z
Kenji: Walter agreed to take a second look at your pull request. Thanks again for all your incredible work.