[Issue 1241] New: ICE on template instance parameter
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri May 18 15:22:23 PDT 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1241
Summary: ICE on template instance parameter
Product: D
Version: 1.014
Platform: PC
OS/Version: All
Status: NEW
Keywords: ice-on-valid-code
Severity: normal
Priority: P2
Component: DMD
AssignedTo: bugzilla at digitalmars.com
ReportedBy: manuelk89 at gmx.net
The following template instance parameter crashes dmd when the parameter gets
accessed:
template List(L...)
{
alias L get;
}
template Foo(alias A)
{
int len1 = A.get.length; // access causes ICE
}
void main()
{
alias Foo!(List!(1,2,3)) foo; // instance parameter is List!(1,2,3)
}
-------------------------------
compile session:
$ dmd main.d
dmd: expression.c:4729: virtual Expression* DotIdExp::semantic(Scope*):
Assertion `0' failed.
Aborted (core dumped)
---
PS: when this gets fixed there is a nice way to pass more than one Tuple to a
template by just passing several template instances that carry the tuples in
them (just as the List template above).
--
More information about the Digitalmars-d-bugs
mailing list