[Issue 3552] New: Compile time assertion error with associative arrays of class types

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Nov 25 07:35:38 PST 2009


http://d.puremagic.com/issues/show_bug.cgi?id=3552

           Summary: Compile time assertion error with associative arrays
                    of class types
           Product: D
           Version: 2.036
          Platform: x86_64
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: justin.greenwood at gmail.com


--- Comment #0 from Justin Greenwood <justin.greenwood at gmail.com> 2009-11-25 07:35:36 PST ---
Created an attachment (id=518)
The simple example that shows the error.

I have attached two files, both simple code illustrating the error I've run
into. In the testAssociativeArrayFails.d file, there is a foreach block that
iterates through an associative array. If that foreach block is removed, the
file compiles fine. The error is not really meaningful and I imagine the
assertion errors in the compiler should not happen.

To help show what is causing the bug, I wrote the same sample class without
using a Variant internally in my class and everything works fantastically. I
put a shitload of time trying to figure out the error in a much more
complicated program - this error just started when I upgraded to the newest
version of DMD 2.x. I hope you can make use of my example code.


When I run the attached files, this is the output:
-------------------------------------------------------------------------------
F:\projects\home\home-svn\d\www>c:\d\dmd2\windows\bin\dmd.exe
".\src\testAssocia
tiveArrayFails.d" -of.\bin\testAssociativeArrayFails.exe
.\src\testAssociativeArrayFails.d(14): Error: template instance
AssociativeArray
 is not a template declaration, it is a overloadset
Assertion failure: 'impl' on line 3351 in file 'mtype.c'

abnormal program termination

F:\projects\home\home-svn\d\www>.\bin\testAssociativeArrayFails.exe
'.\bin\testAssociativeArrayFails.exe' is not recognized as an internal or
extern
al command,
operable program or batch file.

F:\projects\home\home-svn\d\www>c:\d\dmd2\windows\bin\dmd.exe
".\src\testAssocia
tiveArrayWorks.d" -of.\bin\testAssociativeArrayWorks.exe

F:\projects\home\home-svn\d\www>.\bin\testAssociativeArrayWorks.exe
** Associative Array using Classes without variants **
true = 12.32
12 = 14

-- 
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