Bug 14316 – allow to declare a variable in with statement
Status
RESOLVED
Resolution
DUPLICATE
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-03-22T00:53:00Z
Last change time
2015-03-22T02:49:53Z
Assigned to
nobody
Creator
code
Comments
Comment #0 by code — 2015-03-22T00:53:57Z
Similar to the exception for the if statement, it would be very convenient to allow variable declaration in the with statement, so that a new value can be initialized and returned.
----
with (auto settings = new HTTPServerSettings)
{
port = 8080;
bindAddresses = ["127.0.0.1"];
return settings;
}
----
Comment #1 by ketmar — 2015-03-22T02:49:53Z
*** This issue has been marked as a duplicate of issue 13526 ***