https://issues.dlang.org/show_bug.cgi?id=14316
Issue ID: 14316
Summary: allow to declare a variable in with statement
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P1
Component: DMD
Assignee: [email protected]
Reporter: [email protected]
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;
}
----
--