[svn] r7368: nemerle/trunk/ncc: testsuite/negative/namespace-b231.n typing/Typer.n

nazgul svnadmin at nemerle.org
Thu Feb 1 22:34:42 CET 2007


Log:
Signal error when namespace is used directly

Author: nazgul
Date: Thu Feb  1 22:34:40 2007
New Revision: 7368

Modified:
   nemerle/trunk/ncc/testsuite/negative/namespace-b231.n
   nemerle/trunk/ncc/typing/Typer.n

Modified: nemerle/trunk/ncc/testsuite/negative/namespace-b231.n
==============================================================================
--- nemerle/trunk/ncc/testsuite/negative/namespace-b231.n	(original)
+++ nemerle/trunk/ncc/testsuite/negative/namespace-b231.n	Thu Feb  1 22:34:40 2007
@@ -3,12 +3,19 @@
 
 using Syyyyyyyyyyyyystem; // E: referenced namespace .* does not exist
 
+namespace Foo { }
+
 public module Program
 {
     Main() : void
     {
       def d : DateTime = 1; // E: unbound type name `DateTime'
     }
+    
+    bar () : void {
+        _ = Foo ();   // E: the meaning of .* does not allow this operation
+        
+    }
 }
 
 class A { }

Modified: nemerle/trunk/ncc/typing/Typer.n
==============================================================================
--- nemerle/trunk/ncc/typing/Typer.n	(original)
+++ nemerle/trunk/ncc/typing/Typer.n	Thu Feb  1 22:34:40 2007
@@ -169,13 +169,13 @@
                 MaybeDumpTypedTree ();
               }
             } catch {
-              | _ is RestartInErrorMode =>
+              | e is RestartInErrorMode =>
                 def errcnt = Message.ErrorCount;
                 put_in_error_mode ();
                 RunTyper ();
 
                 when (errcnt == Message.ErrorCount)
-                  Util.ice ($"hidden errors compiling $m");
+                  Util.ice ($"hidden errors compiling $m - $(Message.ErrorCount) vs $errcnt: $(e.StackTrace)");
             }
           } catch {
             | _ is SwitchToYielding =>
@@ -2654,7 +2654,8 @@
         | [] when !for_completion =>
           if (globals.IsEmpty) {
             if (messenger.InErrorMode && solver.IsTopLevel)
-              _ = UnboundName (expr)
+              when (UnboundName (expr))
+                ReportError (messenger, $"the meaning of `$expr' does not allow this operation")
             else
               ReportError (messenger, "you should not see that, please report as a bug")
           } else {



More information about the svn mailing list