Dealing with type information loss in Parameters Fields and Return type

Jonathan M Davis via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Apr 17 06:56:38 PDT 2016


On Sunday, April 17, 2016 12:07:45 Nicholas Wilson via Digitalmars-d-learn 
wrote:
> On Sunday, 17 April 2016 at 11:47:52 UTC, Jonathan M Davis wrote:
> > On Sunday, April 17, 2016 11:00:15 Nicholas Wilson via
> >
> > Digitalmars-d-learn wrote:
> >> On Sunday, 17 April 2016 at 10:48:08 UTC, Jonathan M Davis
> >>
> >> wrote:
> >> > [...]
> >>
> >> Sorry for the confusion, I didn't. getting the string "size_t"
> >> as the result of a hypothetical StringReturnType is the
> >> desired outcome.
> >
> > Then I very much doubt that it's possible. The compiler doesn't
> > distinguish between an alias and the original. As far as it's
> > concerned, they're exactly the same thing. The compiler is
> > pretty much doing the equivalent of textually replacing all
> > instances of an alias with the original.
> >
> > - Jonathan M Davis
>
> Then time for some compiler hacking!!

Perhaps, but be aware that Walter Bright thinks that size_t should stay
as-is:

http://forum.dlang.org/post/nevrsb$2ge1$1@digitalmars.com

Maybe some sort of general change to how aliases work would be acceptable
and would give you what you want. I don't know. But he's against special
casing stuff like size_t.

- Jonathan M Davis



More information about the Digitalmars-d-learn mailing list