Bug 1784 – DMD 1.025 ICE on template parameter following tuple parameter

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
All
OS
All
Creation time
2008-01-11T21:44:00Z
Last change time
2014-02-24T15:31:36Z
Keywords
ice-on-invalid-code
Assigned to
bugzilla
Creator
wetimermad

Comments

Comment #0 by wetimermad — 2008-01-11T21:44:27Z
Code: template A(tuple ..., bool first = true) { } A!() a; Result: dmd: template.c:2474: virtual MATCH TemplateTupleParameter::matchArg(Scope*, Objects*, int, TemplateParameters*, Objects*, Declaration**): Assertion `i + 1 == dedtypes->dim' failed. Aborted (core dumped) I realized after stripping everything down that doing that is probably not legal, but it probably shouldn't assert.
Comment #1 by matti.niemenmaa+dbugzilla — 2008-01-12T03:15:17Z
The default value is unnecessary, anything following the tuple will do: template A(tuple ..., bool first) {} A!() a;
Comment #2 by samukha — 2008-11-13T01:48:05Z
dmd 2.020 and 1.034 print correct error message: template Test.A(tuple...,bool first) template tuple parameter must be last one