https://issues.dlang.org/show_bug.cgi?id=23124
Walter Bright <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |[email protected] Resolution|--- |INVALID --- Comment #1 from Walter Bright <[email protected]> --- The error is: test.d(17): Error: scope variable `myVar` assigned to `outer` with longer lifetime which is a correct error message. `outer` lives longer than the scope of `inner`, so it is an error to set `outer` to pointing at `inner`. If you need it to compile, remove `@safe` from main(). It's a feature of D to do scope inference. Whether the use of a scope pointer is checked or not is dependent on whether the function using the scope pointer is @safe or not. This is working as designed. --
