[Issue 23112] code passes @nogc, allocates anyway

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jun 5 04:31:19 UTC 2022


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

--- Comment #3 from Walter Bright <bugzilla at digitalmars.com> ---
Some further study.

The semantic analysis for call()() cannot be done during the semantic analysis
for bar() or Forward, because the template arguments to call()() are as yet
unknown. We only find out the arguments when main() takes the return value (an
instance of Forward) and calls it.

To fix this, the argument `f` supplied to the parameter `alias F` of `Forward`
must be regarded as escaping when the instance of `Forward` is returned from
`bar()`.

Not doing this is a major hole in the @safe system.

--


More information about the Digitalmars-d-bugs mailing list