[ nice-Bugs-888229 ] equals dispatching on exact type
"SourceForge.net" <[email protected]>
| Newsgroups | gmane.comp.lang.nice.devel |
|---|---|
| Message-ID | <[email protected]> |
Bugs item #888229, was opened at 2004-01-31 18:57
Message generated for change (Comment added) made by bonniot
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=112788&aid=888229&group_id=12788
Category: None
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Isaac Gouy (igouy)
>Assigned to: Daniel Bonniot (bonniot)
Summary: equals dispatching on exact type
Initial Comment:
class A { int i = 0; }
class B extends A { int k = 0; }
equals (#A x, #A y) = x.i == y.i;
equals (#B x, #B y) = x.k == y.k;
void main(String[] args){
let a = new A();
let b = new B();
println( a.equals(a) );
println( a.equals(b) );
println( b.equals(a) );
println( b.equals(b) );
}
\Nice\Test>java -jar t.jar
true
false
true
true
Nice compiler version 0.9.6 prerelease (build 2004.01.30,
19:05:54 UTC)
----------------------------------------------------------------------
Comment By: Daniel Bonniot (bonniot)
Date: 2004-02-02 14:11
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
Note that the bug has first been fixed in the CVS version, and it
might take one or two hours until the development version
includes the fix.
Thanks again for your help by submiting this bug report.
Daniel Bonniot
----------------------------------------------------------------------
Comment By: Daniel Bonniot (bonniot)
Date: 2004-02-01 23:39
Message:
Logged In: YES
user_id=88952
Sorry about the "BTW", I did not read nice-info before!
----------------------------------------------------------------------
Comment By: Daniel Bonniot (bonniot)
Date: 2004-02-01 22:49
Message:
Logged In: YES
user_id=88952
Right, the third value is incorrect, it should be false (the
three others are correct). I checked the bytecode, this is
specific to methods that are declared in Java (like equals,
in java.lang.Object) and that # dispatch on their first
argument.
BTW, it would be nice in general to get some comment with
the report, like why you consider it a bug (when it's not
obvious as with runtime exceptions).
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=112788&aid=888229&group_id=12788
-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn