Nice/testsuite/compiler/methods compilation.testsuite,1.1,1.2

Daniel Bonniot <[email protected]>
Newsgroups gmane.comp.lang.nice.cvs
Message-ID <[email protected]>
Update of /cvsroot/nice/Nice/testsuite/compiler/methods
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15108/testsuite/compiler/methods

Modified Files:
	compilation.testsuite 
Log Message:
Find compiled version of dispatch methods even when they are members of
Nice classes (and not static members of the dispatch class).


Index: compilation.testsuite
===================================================================
RCS file: /cvsroot/nice/Nice/testsuite/compiler/methods/compilation.testsuite,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** compilation.testsuite	20 Mar 2004 15:49:23 -0000	1.1
--- compilation.testsuite	28 Feb 2005 14:00:56 -0000	1.2
***************
*** 9,10 ****
--- 9,36 ----
    String foo() = "ABC";
  }
+ 
+ /// PASS
+   // Check that polymorphic methods compiled inside classes get the right
+   // bytecode type.
+   /// package a
+   /// Toplevel
+ class A {
+   <A T> T foo(T x) = x;
+ }
+   /// package b import a
+   let B b = new B();
+   let A a = new A();
+ 
+   // invoke foo reflexively.
+   // the method should be A.foo(A);
+   let methodFoo = A.class.getMethod("foo", [A.class]);
+   methodFoo.invoke(a, [b]);
+ 
+   assert b.ran;
+ 
+   /// Toplevel
+ final class B extends A {
+   boolean ran = false;
+ }
+ 
+ foo(A a, B b) { b.ran = true; return b; }



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
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.