You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
!!!There are attachements in the bugzilla issue that have not been copied over!!!
The text was updated successfully, but these errors were encountered:
Created attachment 1432
preliminary realization
this is quick-and-dirty patch that allows declarations in with(). hdrgen emits fixed .di files too.
please note that this is my first patch outside of parser scope and i'm not sure what i'm doing here. it seems to work on simple test cases (see second attachement) but it need to be reviewed by someone who knows compiler internals.
so far the patch seems to not breaking existing code, so it can be safely tested.
Andre reported this on 2014-09-24T14:37:39Z
Transferred from https://issues.dlang.org/show_bug.cgi?id=13526
CC List
Description
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.!!!There are attachements in the bugzilla issue that have not been copied over!!!
The text was updated successfully, but these errors were encountered: