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

           Summary: Multiple-at-a-time bug breaking e.g. DustMite
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Mac OS X
            Status: NEW
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: c...@klickverbot.at


--- Comment #0 from klickverbot <c...@klickverbot.at> 2011-07-28 10:55:29 PDT 
---
The test case, reduced as much as I easily could achieve (I spent too much time
on this already, maybe I've missed something obvious):

a.d:
---
import c;
---

b.d:
---
import c;

int regex(string pattern)
{
  return 0;
}

bool match(string r)
{
  return true;
}

void applyNoRemoveRegex()
{
  void scan(string[] noRemoveStr, string e)
  {
    auto a = find!((a){return match(e);})(map!regex(noRemoveStr));
  }
}
---

c.d:
---
template map(alias fun) {
  auto map(Range)(Range r) {
    struct Result
    {
      @property auto ref front()
      {
        return fun("a");
      }
    }
    return Result();
  }
}

Range find(alias pred, Range)(Range haystack) {
  pred(haystack.front);
  return haystack;
}
---

$ dmd -c a.d b.d
Assertion failed: (!vthis->csym), function toObjFile, file glue.c, line 719.
Abort trap: 6

If you reverse the source files in the dmd parameter list, the example compiles
fine.

The bug was found by trying to compile DustMite with DMD 2.054
(https://github.com/CyberShadow/DustMite/wiki/Building-DustMite).

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

Reply via email to