www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1784] New: DMD 1.025 asserts tuples mixed with defaults

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1784

           Summary: DMD 1.025 asserts tuples mixed with defaults
           Product: D
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: WinstonEwert gmail.com


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.


-- 
Jan 11 2008
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1784


matti.niemenmaa+dbugzilla iki.fi changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-invalid-code
         OS/Version|Linux                       |All
           Platform|PC                          |All
            Summary|DMD 1.025 asserts tuples    |DMD 1.025 ICE on template
                   |mixed with defaults         |parameter following tuple
                   |                            |parameter
            Version|unspecified                 |1.025




------- Comment #1 from matti.niemenmaa+dbugzilla iki.fi  2008-01-12 03:15
-------
The default value is unnecessary, anything following the tuple will do:

template A(tuple ..., bool first) {}

A!() a;


-- 
Jan 12 2008
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1784


samukha voliacable.com changed:

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




------- Comment #2 from samukha voliacable.com  2008-11-13 01:48 -------
dmd 2.020 and 1.034 print correct error message: template Test.A(tuple...,bool
first) template tuple parameter must be last one


-- 
Nov 12 2008