[Issue 13526] New: Allow statement: with(auto p = new Panel())
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Wed Sep 24 07:37:39 PDT 2014
https://issues.dlang.org/show_bug.cgi?id=13526
Issue ID: 13526
Summary: Allow statement: with(auto p = new Panel())
Product: D
Version: D2
Hardware: x86_64
OS: Windows
Status: NEW
Severity: enhancement
Priority: P1
Component: DMD
Assignee: nobody at puremagic.com
Reporter: andre at s-e-a-p.de
Currently this code is not accepted:
with (auto p = new Panel())
{
parent = this;
text = "bla";
with (new Button())
{
parent = p; // Here p is needed
text = "bla2";
}
}
auto is not allowed in with statement. p is needed as parent attribute
of the new button.
One workaround would be to change the coding to:
Panel p;
with (p = new Panel()) {...}
While this coding is working, it seems like a missing feature auto
is not working.
Could you check?
In the discussion
http://forum.dlang.org/thread/alaqjnmfckedhuvypvps@forum.dlang.org
also someone mentioned auto would make sense in switch,
but can't judge on that.
--
More information about the Digitalmars-d-bugs
mailing list