Update of /cvsroot/nice/Nice/testsuite/compiler/classes
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29266/testsuite/compiler/classes
Modified Files:
typeParameters.testsuite
Added Files:
specialization.testsuite
Log Message:
Allow subclasses to have less type parameters than their parent, by
instantiation of some of their type parameters.
--- NEW FILE: specialization.testsuite ---
/// PASS
B b = new B(x: "");
String s = b.x;
/// Toplevel
class A<T> { T x; }
class B extends A<String> {}
/// PASS
B b = new B();
String s = b.get();
/// Toplevel
abstract class A<T> { T get(); }
class B extends A<String> { get() = ""; }
/// PASS
B b = new B();
String s = b.get();
/// Toplevel
interface A<T> { T get(); }
class B implements A<String> { get() = ""; }
/// FAIL
B /*/// FAIL HERE */ b = new B(x: 0);
/// Toplevel
class A<T> { T x; }
class B extends A<String> {}
/// PASS
B<int> b = new B(x: 0, y: "");
C<int> c = new C(x: "", y: 0);
/// Toplevel
class A<T,U> { T x; U y; }
class B<V> extends A<V, String> {}
class C<W> extends A<String, W> {}
/// PASS
B<int,boolean> b = new B(x: 0, y: "", z: false);
C<int,boolean> c = new C(x: true, y: "", z: 0);
/// Toplevel
class A<T,U,V> { T x; U y; V z; }
class B<T,V> extends A<T, String, V> {}
class C<T,V> extends A<V, String, T> {}
Index: typeParameters.testsuite
===================================================================
RCS file: /cvsroot/nice/Nice/testsuite/compiler/classes/typeParameters.testsuite,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** typeParameters.testsuite 16 Jul 2004 10:01:32 -0000 1.18
--- typeParameters.testsuite 12 Aug 2004 23:21:41 -0000 1.19
***************
*** 367,368 ****
--- 367,373 ----
get(i) = null;
}
+
+ /// FAIL
+ /// Toplevel
+ class A<T> {}
+ class B<T> extends A<U> {}
|