Bug: compiler crash when using module name twice

Matthias m.atthi.as at example.net
Thu May 27 14:57:47 PDT 2010


I'm very new to D and misused the module identifier, I thought it would 
be the namespace/package name.

The dmd compiler v2.046 produces correct output ("Error: module test 
from file xxx.d conflicts with another module test from file yyy.d"), if 
multiple placement of same module identifier are in the root of the 
project, however it crashes, when the files are in a subfolder and does 
not display a proper error message.

The output is:
Assertion failure: 'mprev' on line 641 in file 'module.c'

Test case:
--main.d--
import std.stdio;

import folder.File1;
import folder.File2;

int main(char[][] args)
{
     writefln(file2);
     return 0;
}

--folder\File1.d--
module folder;

const char[] file1 = "File1";

--folder\File2.d--
module folder;

const char[] file2 = "File2";

Used Code::Blocks.


More information about the Digitalmars-d mailing list