[Issue 8269] The 'with statement' does not observe temporary object lifetime

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Mar 23 05:18:20 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=8269



--- Comment #3 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2013-03-23 05:18:18 PDT ---
(In reply to comment #0)
> The spec at
> 
>   http://dlang.org/statement.html#WithStatement
> 
> says:
> 
> <quote>
> The WithStatement
> with (expression)
> {
>   ...
>   ident;
> }
> is semantically equivalent to:
> {
>   Object tmp;
>   tmp = expression;
>   ...
>   tmp.ident;
> }
> </quote>

What it does end up doing is inject an initializer and a comma expression, and
then takes the address of that. It's totally bizarre..

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list