D-Programming-Language/phobos — pull request #496 by adamdruppe (2012-03-16 22:05:19+00:00)
Title: coerce string to other types workaround

This is just a quick workaround for an annoying bug. It looks like this is supposed to work.

void main() {
Variant a = "10";
int a = a.coerce!int; // currently throws, but this little fix takes care of it
}
object.Exception@variant.d(708): Type immutable(char)[] does not convert to int

I hate that error message too (no __FILE__ and __LINE__), but one thing at a time...