[Issue 22221] [dip1000] pure function can escape parameters through Exception

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Mar 14 13:17:05 UTC 2022


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

--- Comment #7 from Atila Neves <atila.neves at gmail.com> ---
> The compiler thinks "`scope` inference failed

On a non templated function?

> How are you going to explain to D users why `enforce` now has an extra `null` argument?

With a comment on enforce. It's not ideal, but I think it's better than the
current situation.

>> This is ugly but it's for a niche use-case and other than introducing a
>> keyword or some way to mark the function as "pure but don't scope my params"

> If you want to mark the function as "pure but don't scope my params", then mark it > `pure` and add `scope` to the parameters.

That doesn't make any sense to me. What we want is to rely on inference as much
as possible instead of explicit `scope` on parameters.

--


More information about the Digitalmars-d-bugs mailing list