[Issue 3880] std.regex functions with const/immutable Regex object

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Nov 11 06:28:28 PST 2016


https://issues.dlang.org/show_bug.cgi?id=3880

John Colvin <john.loughran.colvin at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
                 CC|                            |john.loughran.colvin at gmail.
                   |                            |com
         Resolution|FIXED                       |---

--- Comment #2 from John Colvin <john.loughran.colvin at gmail.com> ---
Seems like this is still happening:

auto foo()
{
    import std.regex : regex, matchFirst;
    const r = regex("asdf");
    matchFirst("fdsaf", r);
}

test.d(5): Error: template std.regex.matchFirst cannot deduce function from
argument types !()(string, const(Regex!char)), candidates are:
/usr/local/Cellar/dmd/2.072.0/include/dlang/dmd/std/regex/package.d(934):      
 std.regex.matchFirst(R, RegEx)(R input, RegEx re) if (isSomeString!R &&
is(RegEx == Regex!(BasicElementOf!R)))
/usr/local/Cellar/dmd/2.072.0/include/dlang/dmd/std/regex/package.d(942):      
 std.regex.matchFirst(R, String)(R input, String re) if (isSomeString!R &&
isSomeString!String)
/usr/local/Cellar/dmd/2.072.0/include/dlang/dmd/std/regex/package.d(950):      
 std.regex.matchFirst(R, String)(R input, String[] re...) if (isSomeString!R &&
isSomeString!String)
/usr/local/Cellar/dmd/2.072.0/include/dlang/dmd/std/regex/package.d(957):      
 std.regex.matchFirst(R, RegEx)(R input, RegEx re) if (isSomeString!R &&
is(RegEx == StaticRegex!(BasicElementOf!R)))

--


More information about the Digitalmars-d-bugs mailing list