[svn]
r7790: nemerle/trunk/ncc/testsuite/negative/where-constraints3.n
nazgul
svnadmin at nemerle.org
Thu Sep 6 13:28:16 CEST 2007
Log:
Testcase for 1023
Author: nazgul
Date: Thu Sep 6 13:28:15 2007
New Revision: 7790
Added:
nemerle/trunk/ncc/testsuite/negative/where-constraints3.n (contents, props changed)
Added: nemerle/trunk/ncc/testsuite/negative/where-constraints3.n
==============================================================================
--- (empty file)
+++ nemerle/trunk/ncc/testsuite/negative/where-constraints3.n Thu Sep 6 13:28:15 2007
@@ -0,0 +1,24 @@
+abstract class Base[T]
+{
+ public abstract Foo[S](_obj : S) : void where S : T;
+}
+
+class Derived : Base[int?]
+{
+ public override Foo[S](obj : S) : void
+ {
+ // the error message is not quite right here, as it is simply
+ // invalid to use int? in T:struct context
+ Bar(obj); // E: the type .*S.* in order to use it as type parameter .T. in method Derived.Bar
+ }
+
+ static Bar[T](_obj : T) : void where T : struct
+ {
+
+ }
+
+ static Main() : void
+ {
+ Derived().Foo.[int?](1);
+ }
+}
More information about the svn
mailing list