[svn] r7721: nemerle/trunk/ncc: testsuite/negative/void-parm4.n typing/StaticTyVar.n

divan svnadmin at nemerle.org
Thu Jun 28 23:02:00 CEST 2007


Log:
Fix bug 855.

Author: divan
Date: Thu Jun 28 23:01:57 2007
New Revision: 7721

Added:
   nemerle/trunk/ncc/testsuite/negative/void-parm4.n
Modified:
   nemerle/trunk/ncc/typing/StaticTyVar.n

Added: nemerle/trunk/ncc/testsuite/negative/void-parm4.n
==============================================================================
--- (empty file)
+++ nemerle/trunk/ncc/testsuite/negative/void-parm4.n	Thu Jun 28 23:01:57 2007
@@ -0,0 +1,10 @@
+interface I {}
+
+class Bug855 {
+  public Foo[T](x : T) : void where T : void { //E: cannot use `void' as constraint for T
+  }
+  public Bar[T](x : T) : void where T : void, I { //E: cannot use `void' as constraint for T
+  }
+}
+
+_ = 1;

Modified: nemerle/trunk/ncc/typing/StaticTyVar.n
==============================================================================
--- nemerle/trunk/ncc/typing/StaticTyVar.n	(original)
+++ nemerle/trunk/ncc/typing/StaticTyVar.n	Thu Jun 28 23:01:57 2007
@@ -61,8 +61,13 @@
       set {
         assert (constraints == null);
         constraints = value;
-        unless (value.IsEmpty)
+        unless (value.IsEmpty) {
           LowerBound.Validate ();
+          List.Iter (constraints, fun (x) {
+            when (x.Equals (InternalType.Void))
+              Message.Error ($ "cannot use `void' as constraint for $(Name)")
+          })
+        }
       }
     }
 



More information about the svn mailing list