[ nice-Bugs-1070054 ] Nice allows multiple inequal retypings of a java method

"SourceForge.net" <[email protected]> Sun, 21 Nov 2004 07:48:09 -0800
Newsgroups gmane.comp.lang.nice.devel
Message-ID <[email protected]>
Bugs item #1070054, was opened at 2004-11-20 17:05
Message generated for change (Comment added) made by bonniot
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=112788&aid=1070054&group_id=12788

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Luc Perrin (leblin)
Assigned to: Nobody/Anonymous (nobody)
Summary: Nice allows multiple inequal retypings of a java method

Initial Comment:
Java:

public class A {
    int getN( ) { return 0; }
}

Nice:

int getN(A) = native int A.getN();
boolean getN(A) = native int A.getN();


Nice will compile this code quietly.




----------------------------------------------------------------------

>Comment By: Daniel Bonniot (bonniot)
Date: 2004-11-21 16:48

Message:
Logged In: YES 
user_id=88952

Yes, it's not an error in itself to give several retypings
for the same method. Besides, Nice's type system being more
expressive than Java's, it's impossible to automatically
check if the retyping has the correct type. Therefore, I
would advise to just close this report.

One thing that could be done is to check the erasure of the
Nice type, and compare it to the Java type. If they don't
match somehow, one might want to give a warning or an error.
If you feel strongly about this, you could change the report
into a feature request for that.

----------------------------------------------------------------------

Comment By: Arjan Boeijink (arjanb)
Date: 2004-11-20 19:15

Message:
Logged In: YES 
user_id=688815

I'm not sure this is a bug. Sometimes it's usefull to have 
multiple retypings of a single method.
For example in nice.lang:
char get(String s, int index) = native char String.charAt(int);
char charAt(String s, int index) = native char String.charAt
(int);


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=112788&aid=1070054&group_id=12788


-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE
FREE OODBMS DOWNLOAD - A multidimensional database that combines
robust object and relational technologies, making it a perfect match
for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8