On Fri, 25 Apr 2014 08:21:38 -0400, David Nadlinger <[email protected]>
wrote:
On Friday, 25 April 2014 at 12:07:00 UTC, Steven Schveighoffer wrote:
One interesting thing about this is that the compiler implementation
may make some @nogc code valid on some compilers, and invalid on
others, even though the resulting execution is the same.
I don't think this is a desirable behavior. @nogc should be decided in
the frontend, before closure allocation optimizations take place.
I don't know that it's desirable to have @nogc reject code even though an
allocation does not occur. I agree the situation is not ideal, but @nogc
is a practical optimization.
I can think of other cases where the GC may be optimized out. To reject
such code in @nogc would make it much less attractive.
-Steve