Bug 11285 – [REG2.064 beta 1] std.regex.replace with CTRE error: no return exp; or assert(0); at end of function

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-10-16T18:13:00Z
Last change time
2013-10-17T02:00:41Z
Assigned to
nobody
Creator
growlercab

Comments

Comment #0 by growlercab — 2013-10-16T18:13:09Z
--- import std.regex:ctRegex, replace; void main() { enum ctre = ctRegex!(".*why not"); string msg = "blah blah why not use a regex?"; msg = replace(msg, ctre, "why"); } --- $ dmd test.d dmd2/import/std/regex.d(6107): Error: template std.regex.replaceMatchesInto does not match any function template declaration. Candidates are: dmd2/import/std/regex.d(6067): std.regex.replaceMatchesInto(alias output, Sink, R, T)(ref Sink sink, R input, T matches) if (isOutputRange!(Sink, dchar) && isSomeString!R && is(T == RegexMatch!R)) dmd2/import/std/regex.d(6107): Error: template std.regex.replaceMatchesInto(alias output, Sink, R, T)(ref Sink sink, R input, T matches) if (isOutputRange!(Sink, dchar) && isSomeString!R && is(T == RegexMatch!R)) cannot deduce template function from argument types !(__lambda4)(Appender!string, string, RegexMatch!(string, BacktrackingMatcher)) dmd2/import/std/regex.d(6099): Error: function std.regex.replace!(match, string, char, StaticRegex!char).replace.replaceAllWith!((m, sink) => replaceFmt(format, m, sink), match, string, StaticRegex!char).replaceAllWith no return exp; or assert(0); at end of function dmd2/import/std/regex.d(6393): Error: template instance std.regex.replace!(match, string, char, StaticRegex!char).replace.replaceAllWith!((m, sink) => replaceFmt(format, m, sink), match, string, StaticRegex!char) error instantiating test.d(5): instantiated from here: replace!(match, string, char, StaticRegex!char) test.d(5): Error: template instance std.regex.replace!(match, string, char, StaticRegex!char) error instantiating
Comment #1 by dmitry.olsh — 2013-10-17T02:00:41Z
*** This issue has been marked as a duplicate of issue 11262 ***