[ nice-Bugs-1096722 ] requires doesn't work like assert. SHould
"SourceForge.net" <[email protected]> Wed, 05 Jan 2005 14:11:46 -0800
| Newsgroups | gmane.comp.lang.nice.devel |
|---|---|
| Message-ID | <[email protected]> |
Bugs item #1096722, was opened at 2005-01-05 21:55
Message generated for change (Comment added) made by arjanb
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=112788&aid=1096722&group_id=12788
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: mike.beckerle (mbeckerle)
Assigned to: Nobody/Anonymous (nobody)
Summary: requires doesn't work like assert. SHould
Initial Comment:
int foo(Object arg) requires (arg instanceof Integer)
{
// assert(arg instanceof Integer); // redundant
return arg.intValue();
}
Version 0.9.10
Problem is that a requires clause which narrows the type
should be respected to the same extent as an assertion.
----------------------------------------------------------------------
>Comment By: Arjan Boeijink (arjanb)
Date: 2005-01-05 23:11
Message:
Logged In: YES
user_id=688815
This is not a bug I think.
All things that are expressable in the arguments types don't
need to be in preconditions.
Why not write:
int foo(int arg) instead?
btw Integer is the java class and should usually not be used
in Nice code.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=112788&aid=1096722&group_id=12788
-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt