[ nice-Bugs-926524 ] compiler detecting tests for nullness
"SourceForge.net" <[email protected]> Wed, 31 Mar 2004 00:23:03 -0800
| Newsgroups | gmane.comp.lang.nice.devel |
|---|---|
| Message-ID | <[email protected]> |
Bugs item #926524, was opened at 2004-03-31 16:23
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=112788&aid=926524&group_id=12788
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Francis Barber (fbarber)
Assigned to: Nobody/Anonymous (nobody)
Summary: compiler detecting tests for nullness
Initial Comment:
The compiler complains about the following code:
String s;
s = gv.docString() != null ? gv.docString() : "null";
The error is:
The value if(`!=`(gv.docString(), null))
gv.docString()
else
"null"
cannot be assigned to s because it might be null.
However, the following code compiles fine:
void bar(?String arg) {
String s;
s = arg != null ? arg : "null";
}
Thanks,
Frank.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=112788&aid=926524&group_id=12788
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click