On Wed, Oct 16, 2013 at 02:10:02PM -0700, H. S. Teoh wrote:
> On Wed, Oct 16, 2013 at 10:09:50PM +0200, Daniel Davidson wrote:
> [...]
> > I reported my issue with the `chain` function to this NG and tried
> > to start annotating items used by chain with pure to see how far the
> > thread led. Honestly it was quickly clear that it led too far for me
> > to follow it and someone else indicated the problem had to do with
> > Voldermort types. If there is more I could do to "benefit us all",
> > beyond learning how it works and what to avoid in my own code - I
> > will be glad to try.
> 
> Hmm. I just did a quick-n-dirty change to Phobos, and it seems to make
> chain() usable with pure code. I'm not sure why the compiler didn't
> infer pure for it -- it should. (Or perhaps I'm missing something
> obvious -- I didn't run the Phobos unittest so maybe the following
> change breaks something.)
[...]

Actually, I just remembered why. It's because attribute inference only
happens for the template function itself, but not for any nested structs
or struct members. Arguably, the compiler should also do inference for
all nested declarations in a template too.

Do you have a bugzilla ticket for this issue? I'd like to add my
findings to it. Thanks!


T

-- 
Without geometry, life would be pointless. -- VS

Reply via email to