[Issue 11262] New: std.regex.replace does not accept StaticRegex

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Oct 14 12:03:22 PDT 2013


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

           Summary: std.regex.replace does not accept StaticRegex
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: Jesse.K.Phillips+D at gmail.com


--- Comment #0 from Jesse Phillips <Jesse.K.Phillips+D at gmail.com> 2013-10-14 12:03:21 PDT ---
When using a ctRegex for replace, the compiler is unable to locate a proper
overload. This worked in 2.63.

import std.regex;

void main() {
    enum reg = ctRegex!(r",", "g");
    auto str = "This,List";
    str = str.replace(reg, "-");
}

--------------

C:\opt\dmd\windows\bin\..\..\src\phobos\std\regex.d(6107): Error: template
std.regex.repla
ceMatchesInto does not match any function template declaration. Candidates are:
C:\opt\dmd\windows\bin\..\..\src\phobos\std\regex.d(6067):       
std.regex.replaceMatches
Into(alias output, Sink, R, T)(ref Sink sink, R input, T matches) if
(isOutputRange!(Sink,
 dchar) && isSomeString!R && is(T == RegexMatch!R))
C:\opt\dmd\windows\bin\..\..\src\phobos\std\regex.d(6107): Error: template
std.regex.repla
ceMatchesInto(alias output, Sink, R, T)(ref Sink sink, R input, T matches) if
(isOutputRan
ge!(Sink, dchar) && isSomeString!R && is(T == RegexMatch!R)) cannot deduce
template functi
on from argument types !(__lambda4)(Appender!string, string,
RegexMatch!(string, Backtrack
ingMatcher))
C:\opt\dmd\windows\bin\..\..\src\phobos\std\regex.d(6099): Error: function
std.regex.repla
ce!(match, string, char, StaticRegex!char).replace.replaceAllWith!((m, sink) =>
replaceFmt
(format, m, sink), match, string, StaticRegex!char).replaceAllWith no return
exp; or asser
t(0); at end of function
C:\opt\dmd\windows\bin\..\..\src\phobos\std\regex.d(6393): Error: template
instance std.re
gex.replace!(match, string, char, StaticRegex!char).replace.replaceAllWith!((m,
sink) => r
eplaceFmt(format, m, sink), match, string, StaticRegex!char) error
instantiating
.\regct.d(6):        instantiated from here: replace!(match, string, char,
StaticRegex!cha
r)
.\regct.d(6): Error: template instance std.regex.replace!(match, string, char,
StaticRegex
!char) error instantiating

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