[ nice-Bugs-866839 ] linking never completes
"SourceForge.net" <[email protected]> Sat, 26 Jun 2004 06:29:51 -0700
| Newsgroups | gmane.comp.lang.nice.devel |
|---|---|
| Message-ID | <[email protected]> |
Bugs item #866839, was opened at 2003-12-29 00:09
Message generated for change (Comment added) made by bonniot
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=112788&aid=866839&group_id=12788
Category: None
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Isaac Gouy (igouy)
>Assigned to: Daniel Bonniot (bonniot)
Summary: linking never completes
Initial Comment:
2 files in same folder graph_test
linking never completes
Nice compiler version 0.9.6 prerelease (build 2003.12.25,
01:41:55 UTC)
I:\pls\Nice\graph_test>nicec --sourcepath .. -a t.jar
graph_test
nice.lang: parsing
graph_test: parsing
graph_test: typechecking
graph_test: generating code
graph_test: linking
//UtilityInterfaces.nice
//--------------------
public interface ReadablePropertyMap<Key,Value> {
Value get(!Key k);
}
public interface ReadWritePropertyMap<Key,Value>
extends
ReadablePropertyMap<Key,Value> {
void set(!Key k, Value v);
}
//hash_property_map.nice
//-----------------------
public class hash_property_map<A,B> implements
ReadWritePropertyMap<A,B> {
private HashMap<A,B> data = new HashMap();
public void set(A a, B b) {
data.put(a,b);
}
public B get(A a) {
return notNull(data.get(a));
}
}
----------------------------------------------------------------------
>Comment By: Daniel Bonniot (bonniot)
Date: 2004-06-26 15:29
Message:
Logged In: YES
user_id=88952
This was fixed a few days ago, since we correctly handle
nullness markers on type variables.
Note that the method coverage will fail, because the methods
get and set for hash_property_map are not overrides of the
specifications (they accept null keys), so they just declare
new methods.
This advocates for the fact that you should not use method
declarations for implementing an existing one (which is a
flaw in the Java model). Either simply implement them:
set(a,b) = data.put(a,b);
or explicitely override them with the override keyword.
----------------------------------------------------------------------
Comment By: Daniel Bonniot (bonniot)
Date: 2003-12-29 10:35
Message:
Logged In: YES
user_id=88952
I think the problem comes from the ! marker. You should not
do:
public interface ReadablePropertyMap<Key,Value> {
Value get(!Key k);
}
but instead:
public interface ReadablePropertyMap<!Key,Value> {
Value get(Key k);
}
Both should indeed be equivalent, but at the moment only the
second one will work.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=112788&aid=866839&group_id=12788
-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 -
digital self defense, top technical experts, no vendor pitches,
unmatched networking opportunities. Visit www.blackhat.com