[Issue 714] New: accessing <enum>.max from another module causes a compiler segmentfault

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Dec 22 05:23:00 PST 2006


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

           Summary: accessing <enum>.max from another module causes a
                    compiler segmentfault
           Product: D
           Version: 0.177
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: thomas-dloop at kuehne.cn


(Originally posted by Stewart Gordon <smjg_1998 at yahoo.com>
on 2005-10-26 as news:djnicb$1a5t$1 at digitaldaemon.com)

a.d:
#
# module a;
# import b;
#
# int array[Enum.max + 1];
#
# int main(){
#    assert(array.length == 3);
#    return 0;
# }
#

b.d:
#
# module b;
# import a;
#
# enum Enum {
#    A = -1,
#    B = 2
# }
#

dmd a.d b.d:
success

dmd b.d a.d:
run/i/import_11_B.d(14): Error: enum Enum is forward referenced
<segmentfault>

test cases:
http://dstress.kuehne.cn/run/i/import_11_A.d
http://dstress.kuehne.cn/run/i/import_11_B.d


-- 



More information about the Digitalmars-d-bugs mailing list