On Tuesday, 17 March 2015 at 18:14:48 UTC, Jonathan M Davis wrote:
How long is the ref returned by getFoo even valid? Maybe it refers to memorythat gets freed on the next line. The compiler can't know.
The problem is not specific to variables, any reference type has that issue.