Bug 15716 – How to resolve the warning explicit braces to avoid ambiguous else
Status
RESOLVED
Resolution
INVALID
Severity
enhancement
Priority
P1
Component
tools
Product
D
Version
D2
Platform
Other
OS
Mac OS X
Creation time
2016-02-23T23:53:00Z
Last change time
2016-02-23T23:57:56Z
Assigned to
nobody
Creator
Varsh.rk14
Comments
Comment #0 by Varsh.rk14 — 2016-02-23T23:53:04Z
Comment #1 by mathias.lang — 2016-02-23T23:57:56Z
If you have any question, please direct them to the "learn" section of the forum: https://forum.dlang.org/group/learn as we only use bugzilla for defect.
To answer your question, do exactly what the warning suggest: nest your statement within braces, so that code like:
```
if (foo)
if (bar)
call();
else
otherCall();
```
Becomes:
```
if (foo)
{
if (bar)
call();
else
otherCall();
}
```
Closing as it is not a bug.