[svn] r7821: nemerle/trunk/ncc: generation/Typer3.n testsuite/negative/array2.n

divan svnadmin at nemerle.org
Sat Oct 20 21:59:33 CEST 2007


Log:
Add final check for arrays of void (now really fixes 880).

Author: divan
Date: Sat Oct 20 21:59:31 2007
New Revision: 7821

Added:
   nemerle/trunk/ncc/testsuite/negative/array2.n   (contents, props changed)
Modified:
   nemerle/trunk/ncc/generation/Typer3.n

Modified: nemerle/trunk/ncc/generation/Typer3.n
==============================================================================
--- nemerle/trunk/ncc/generation/Typer3.n	(original)
+++ nemerle/trunk/ncc/generation/Typer3.n	Sat Oct 20 21:59:31 2007
@@ -2184,6 +2184,11 @@
               }
           }
 
+        | TExpr.Array (args, _) =>
+          when (List.Exists (args, x => x.Type.Fix () is MType.Void))
+            Message.Error ("array element type cannot be void");
+          null
+         
         | _ => null
       }
     }

Added: nemerle/trunk/ncc/testsuite/negative/array2.n
==============================================================================
--- (empty file)
+++ nemerle/trunk/ncc/testsuite/negative/array2.n	Sat Oct 20 21:59:31 2007
@@ -0,0 +1,10 @@
+class Bug880 {
+  class A {
+    public f () : void {
+    }
+  }
+  bar () : void {
+    def g = x => array[x.f ()]; // E: array element type cannot be void
+    _ = g (A ())
+  }
+}
\ No newline at end of file



More information about the svn mailing list