https://issues.dlang.org/show_bug.cgi?id=16056

--- Comment #4 from Eyal Lotem <eyal.lo...@gmail.com> ---
immutable void delegate() pure(In reply to ag0aep6g from comment #3)
> (In reply to Eyal Lotem from comment #2)
> > This is simpler -- but this simpler example isn't a bug: a pure func that
> > takes a mutable delegate is "weakly pure" because it doesn't take an
> > immutable argument. You could say that the simplified pure func takes an
> > explicitly mutable argument, so it is known to be weakly pure.
> 
> pure_func's parameter isn't mutable. It's explicitly marked immutable.

immutable void delegate() pure

vs.

immutable void delegate() immutable pure

Arguably, you can claim that if you've chosen the former form, you knowingly
forfeited mutability for the delegate.

However, once the delegate is wrapped in a struct, you would expect that
transitivity would take care of full immutability.

--

Reply via email to