www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 4449] New: ICE(glue.c) on failed type inference against associative array

reply d-bugmail puremagic.com writes:
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 puremagic.com
        ReportedBy: rsinfu gmail.com


--- Comment #0 from Shin Fujishiro <rsinfu 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: -------
Jul 12 2010
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4449


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |clugdbug yahoo.com.au
         Resolution|                            |DUPLICATE


--- Comment #1 from Don <clugdbug yahoo.com.au> 2010-07-13 08:14:33 PDT ---
*** This issue has been marked as a duplicate of issue 3996 ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 13 2010