On Fri, 25 Apr 2014 21:18:21 GMT, Darius Clark wrote:

Thank you for your answer. Oddly, that did fix that issue but any reason why it would cause that error? I had to kind of recode the way the function work to return the proper information. Also thank you for the tip on on res.readJson(). That made it simple enough. I was looking for something like that but couldnt find it (might not look hard enough).

I think the reason is that anonymous functions/delegates without explicit parameter types, like the ones used here, are internally rewritten as templates taking any parameter type*. But when the contents of an implicitly instantiated template (by matching parameter types) trigger an error, the error isn't printed, but instead the template instantiation for that specific set of template parameters is marked as a failure and the original error is supressed. This is important for overloading templated functions, but results in weird error messages here. Hope this makes some sense.

Disclaimer: I'm not an expert for details of the DMD implementation, so this may not be an accurate description.

* Thinking about it, instead of a nested function, you could also try to use explicit parameter types in the original code (i.e. (scope HTTPClientResponse res)) and see how that influences the error message.