On 06.12.2011 12:33, Nick Sabalausky wrote:
From: "Dmitry Olshansky" <[email protected]>
On 06.12.2011 10:34, Nick Sabalausky wrote:
From: "Nick Sabalausky" <[email protected]>
In one of my programs I'm getting:
D:\DevTool\dmd2beta\dmd2\windows\bin\..\..\src\phobos\std\regex.d(6576):
Error: cannot implicitly convert expression (m) of type
Captures!(string,uint) to RegexMatch!(string,ThompsonMatcher)
Which isn't very helpful. I'm tracking down the code that's
triggering it...
Test case:
import std.regex;
void main()
{
std.regex.replace!(
(RegexMatch!string m) { return ""; }
)( "", regex("") );
}
That's the breaking change, and there is no way out of it. This one
should work:
std.regex.replace!(
( m) { return ""; }
)( "", regex("") );
or
std.regex.replace!(
(Captures!string m) { return ""; }
)( "", regex("") );
Ok, I see.
Is there nothing that can be done to get an error message on the
offending line in the user's code? Like a template contraint on
replace or something?
Good idea. I'll try to add an overload for RegexMatch that does
pragma(error) with some meaningful message and _LINE_ .
--
Dmitry Olshansky
_______________________________________________
dmd-beta mailing list
[email protected]
http://lists.puremagic.com/mailman/listinfo/dmd-beta