[ nice-Bugs-825272 ] nice -> java -> nice fails

"SourceForge.net" <[email protected]>
Newsgroups gmane.comp.lang.nice.devel
Message-ID <[email protected]>
Bugs item #825272, was opened at 2003-10-17 16:35
Message generated for change (Comment added) made by dr_dee
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=112788&aid=825272&group_id=12788

Category: None
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Rohan Hart (dr_dee)
Assigned to: Daniel Bonniot (bonniot)
Summary: nice -> java -> nice fails

Initial Comment:
It seems that nice can't use a java class which
implements a nice interface.

----
package C;

interface In {}

----
package B;

public class Bj implements C.In {}

----
package A;

import B.*;
import C;

class An {
  In b = new Bj();
}

----
nicec --jar c.jar C
javac -classpath c.jar B/Bj.java
jar cfv b.jar B/Bj.class
nicec --classpath b.jar:c.jar A

Incorrect type in assignment to b
Found   : B.Bj
Expected: C.In

The original error I hit indicated that nicec couldn't
even find the java class but I haven't been able to
make a testcase yet.

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

>Comment By: Rohan Hart (dr_dee)
Date: 2003-10-30 09:38

Message:
Logged In: YES 
user_id=774102

It's not really a matter of "want" - my compatriot is
unfimilar with Nice and we just need to get our prototype
working asap.

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

Comment By: Daniel Bonniot (bonniot)
Date: 2003-10-29 22:40

Message:
Logged In: YES 
user_id=88952

OK, this looks like a very different issue from the previous
one. This behaviour is expected: you can not implement a
Nice method in Java. Indeed, it might be possible to support
this in the future, but then this is more a feature request
than a bug report. Could you please open a feature request,
with a self-contained example? This way, we can close this
report, and the request will be easier to follow.

Is there a compelling reason why you want to implement Bj in
Java rather than in Nice?


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

Comment By: Rohan Hart (dr_dee)
Date: 2003-10-29 15:26

Message:
Logged In: YES 
user_id=774102

Extend packages B and C like so...
----
package C;

class C {}
interface In {
  void c(C);
}
----
package B;

import C.*;

public class Bj implements In {
    void c(C q) {}
}
----
and the error is then
Method nice.lang.void c(C.In this, C) is declared but never
implemented:
no alternative matches (B.Bj, C.C)


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

Comment By: Daniel Bonniot (bonniot)
Date: 2003-10-29 10:43

Message:
Logged In: YES 
user_id=88952

Do you use the exact same testcase? What exact error messgae
do you get?

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

Comment By: Rohan Hart (dr_dee)
Date: 2003-10-29 09:19

Message:
Logged In: YES 
user_id=774102

Unfortunately I now get a coverage error indicating that the
java class implementation is missing.  There doesn't seem to
be a way around this aside from providing a nice class which
deligates to the java (which can no longer implement the
interface).

There's no rush for a solution - I'd assume it'll be easier
when the multi-dispatch is changed to use java's single
dispatch as the first step.

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

Comment By: Daniel Bonniot (bonniot)
Date: 2003-10-18 05:25

Message:
Logged In: YES 
user_id=88952

This bug has been fixed. The next release of the compiler will
include this correction. In the mean time, I encourage you try
the development version. It contains a version of the compiler
that fixes the bug. Please try it and reopen the bug-report if
you find any problem with it.

To know how to get an install the development version of the
compiler that fixes this bug, please read
http://nice.sourceforge.net/cgi-bin/twiki/view/Dev/DevelopmentVersion

Thanks again for your help by submiting this bug report. 

Daniel Bonniot


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

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


-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?   SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.