[Issue 4449] New: ICE(glue.c) on failed type inference against associative array
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Jul 12 13:14:54 PDT 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4449
Summary: ICE(glue.c) on failed type inference against
associative array
Product: D
Version: 2.041
Platform: x86
OS/Version: All
Status: NEW
Keywords: ice-on-invalid-code
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: rsinfu at gmail.com
--- Comment #0 from Shin Fujishiro <rsinfu at gmail.com> 2010-07-12 13:14:52 PDT ---
DMD (r576) aborts with assertion failure if type inference against an
associative array fails with a struct/union argument.
-------------------- test.d
template Test(T : V[K], K, V) {}
struct S {}
enum pred = __traits(compiles, Test!S);
--------------------
% dmd -c test
Assertion failed: (0), function totym, file glue.c, line 1056.
--------------------
The abort does not occur if the template argument is not a struct.
--------------------
template Test(T : V[K], K, V) {}
enum pred = __traits(compiles, Test!int);
--------------------
The abort does not occur if the infered type is not an associative array.
--------------------
template Test(T : V[], V) {}
struct S{}
enum pred = __traits(compiles, Test!S);
--------------------
The abort does not occur if the failure is not gagged.
--------------------
template Test(T : V[K], K, V) {}
struct S {}
alias Test!S X;
--------------------
% dmd -c test
test.d(1): Error: cannot create associative array V[K]
test.d(3): Error: template instance Test!(S) does not match template
declaration Test(T : V[K],K,V)
--------------------
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list