[Issue 3909] toDelegate handles only a tiny subset of function pointer types

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue May 25 08:12:14 PDT 2010


http://d.puremagic.com/issues/show_bug.cgi?id=3909



--- Comment #3 from Max Samukha <samukha at voliacable.com> 2010-05-25 08:12:12 PDT ---
(In reply to comment #2)
> I just noticed this report now.  Really, the reason this code is so poorly
> designed (I wrote it, and I'll admit in hindsight that it does suck) is bug
> 1818.  The stupid mixin hack was a last-minute workaround for this bug and
> wasn't thought through properly.  This is noted in the comments:
> 
> functional.d around line 550:
> 
>     // Workaround for DMD Bug 1818.
>     mixin("alias " ~ ReturnType!(F).stringof ~
>         " delegate" ~ ParameterTypeTuple!(F).stringof ~ " DelType;");
> 
>     version(none) {
>         // What the code would be if it weren't for bug 1818:
>         alias ReturnType!(F) delegate(ParameterTypeTuple!(F)) DelType;
>     }

Phobos has recently acquired functionality for extracting storage classes from
functions and function parameters. I haven't given it a close look but it seems
to do that by parsing mangled names. Hacky but should make it possible to
correctly generate function types based on other function types.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list