[Issue 15716] How to resolve the warning explicit braces to avoid ambiguous else
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Tue Feb 23 15:57:56 PST 2016
https://issues.dlang.org/show_bug.cgi?id=15716
Mathias Lang <mathias.lang at sociomantic.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
CC| |mathias.lang at sociomantic.co
| |m
Resolution|--- |INVALID
--- Comment #1 from Mathias Lang <mathias.lang at sociomantic.com> ---
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.
--
More information about the Digitalmars-d-bugs
mailing list