On Wednesday, 5 January 2022 at 10:05:02 UTC, Atila Neves wrote:
>I talked to Walter about this and I don't think it's the correct fix. I've been looking at how to do it otherwise.
Why not? Given a signature like:
int fun(string s) pure nothrow;
You can assume s
is scope
, because there's no channel to escape it: return value has no pointers, global variables are not accessible in a pure function, there are no other parameters to assign it to.
But when the signature is this:
int fun(string s) pure;
You can assign s
to an Exception that gets thrown. How would you prevent / detect that?