dip1000 + pure is a DEADLY COMBO

Dennis dkorpel at gmail.com
Fri May 14 09:50:34 UTC 2021


On Friday, 14 May 2021 at 09:02:35 UTC, Per Nordlöw wrote:
> No, pure function can _neither_ access module global _nor_ 
> process global (__gshared) variables whatsoever regardless of 
> `scope` nor `return` qualifier on parameters and return type.
>
> Please show an example that contradicts this statement.

I can't, I agree with the statement.

I'm not saying that adding scope or return breaks pure, it's the 
other way around.
Adding `pure` breaks `scope`, since the compiler incorrectly 
assumes that a `pure` function implies that the parameters are 
`scope`.



More information about the Digitalmars-d mailing list