[svn] r7828: nemerle/trunk/ncc: generation/Typer3.n testsuite/positive/bug1035.n

divan svnadmin at nemerle.org
Fri Oct 26 00:30:20 CEST 2007


Log:
Fix bug 1035.

Author: divan
Date: Fri Oct 26 00:30:16 2007
New Revision: 7828

Added:
   nemerle/trunk/ncc/testsuite/positive/bug1035.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	Fri Oct 26 00:30:16 2007
@@ -2143,6 +2143,7 @@
                 TExpr.DefValIn (handler.Type, orig, PlainRef (val), handler);
               change_happened = true;
               Try_case.Catch (val, Walk (handler))
+
             | Try_case.Filter (orig, filter, handler) when (orig.InClosure) =>
               def val =
                 LocalValue (current_local_fun, orig.Name,
@@ -2156,9 +2157,15 @@
                 TExpr.DefValIn (handler.Type, orig, PlainRef (val), handler);
               change_happened = true;
               Try_case.Filter (val, Walk (filter), Walk (handler))
-            | Try_case.Fault
-            | Try_case.Catch 
-            | Try_case.Filter => case
+
+            | Try_case.Catch (orig, handler) =>
+              Try_case.Catch (orig, Walk (handler))
+
+            | Try_case.Filter (orig, filter, handler) =>
+              Try_case.Filter (orig, Walk (filter), Walk (handler))
+
+            | Try_case.Fault (handler) => 
+              Try_case.Fault (Walk (handler))
           }
           if (need_walk (cases))
             TExpr.Try (Walk (body), cases.Map (walk_case))

Added: nemerle/trunk/ncc/testsuite/positive/bug1035.n
==============================================================================
--- (empty file)
+++ nemerle/trunk/ncc/testsuite/positive/bug1035.n	Fri Oct 26 00:30:16 2007
@@ -0,0 +1,45 @@
+using System;
+
+public class AException : Exception
+{
+    public F () : void
+    {
+    }
+}
+
+public class BException : Exception
+{
+    public static F () : void
+    {
+        System.Console.WriteLine ("OK");
+    }
+}
+
+public class M
+{
+    public static Main () : void
+    {
+        def h (action)
+        {
+            try
+            {
+                action ();
+            }
+            catch
+            {
+                | ex is AException =>
+                    h(() => ex.F ());
+                | _ is BException =>
+                    h(() => BException.F ());
+            }
+        }
+
+        h(() => BException.F ());
+    }
+}
+
+/*
+BEGIN-OUTPUT
+OK
+END-OUTPUT
+*/
\ No newline at end of file



More information about the svn mailing list