Maxim Fomin:

My guess is that before 2.063 immutable int y was implicitly static, but now it is per instance data which requires context pointer which is deduced to be impure - that why compilation fails (try placing static attribute). In other words, before 2.063 this was a function and now it is a delegate. And delegates currently don't play well with constness/immutability.

I think you are right. So is it right to ask D to infer such delegate as pure?

Bye,
bearophile

Reply via email to