Not sure if this is a bug in DMD or Phobos: ----------------- module a; import std.regex; import b; void main() { replace("hello", regex("X"), "Y"); } ----------------- module b; public import std.string; public import std.array; ----------------- > dmd a.d b.d Result: ----------------- a.d(7): Error: std.regex.replace(Range,Engine,String) if (is(Unqual!(Engine) == Regex!(Unqual!(typeof(Range.init[0]))))) at D:\DevTool\dmd\bin\..\src\phobos\std\regex.d(2807) conflicts with __anonymous at -----------------
cat > a.d << CODE module a; import std.regex; import b; void main() { replace("hello", regex("X"), "Y"); } CODE cat > b.d << CODE module b; public import std.string; public import std.array; CODE dmd -c a.d b.d