[ 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: Open
Resolution: Accepted
Priority: 5
Submitted By: Isaac Gouy (igouy)
Assigned to: Nobody/Anonymous (nobody)
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-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
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.