[Issue 24654] Parameters in contracts should be `const`

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jul 9 18:17:24 UTC 2024


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

--- Comment #2 from Bolpat <qs.il.paperinik at gmail.com> ---
(In reply to Nick Treleaven from comment #1)
> The problem with requiring const for out parameters is that the return type
> might not convert to const if it has mutable indirections.

Of course they convert to const. They might not be copyable to initialize a
const variable, but it shouldn't be copied, so I don't see the problem. In
particular, for parameters that already have a definite address and thus are
trivial to reference.

--


More information about the Digitalmars-d-bugs mailing list