Author: miguel
Date: 2007-12-15 00:08:06 -0500 (Sat, 15 Dec 2007)
New Revision: 91348

Added:
   trunk/mcs/tests/gtest-anon-19.cs
Modified:
   trunk/mcs/mcs/ChangeLog
   trunk/mcs/mcs/generic.cs
Log:
2007-12-15  Miguel de Icaza  <[EMAIL PROTECTED]>

        * generic.cs (NullCoalescingOperator.CloneTo): implement this one,
        as this is also created from the parser.  Fixes #349034



Modified: trunk/mcs/mcs/ChangeLog
===================================================================
--- trunk/mcs/mcs/ChangeLog     2007-12-15 04:46:07 UTC (rev 91347)
+++ trunk/mcs/mcs/ChangeLog     2007-12-15 05:08:06 UTC (rev 91348)
@@ -1,3 +1,8 @@
+2007-12-15  Miguel de Icaza  <[EMAIL PROTECTED]>
+
+       * generic.cs (NullCoalescingOperator.CloneTo): implement this one,
+       as this is also created from the parser.  Fixes #349034
+
 2007-12-12  Miguel de Icaza  <[EMAIL PROTECTED]>
 
        * statement.cs (Throw.CloneTo): it is valid to have empty

Modified: trunk/mcs/mcs/generic.cs
===================================================================
--- trunk/mcs/mcs/generic.cs    2007-12-15 04:46:07 UTC (rev 91347)
+++ trunk/mcs/mcs/generic.cs    2007-12-15 05:08:06 UTC (rev 91348)
@@ -3910,6 +3910,14 @@
                                        ig.MarkLabel (end_label);
                                }
                        }
+
+                       protected override void CloneTo (CloneContext clonectx, 
Expression t)
+                       {
+                               NullCoalescingOperator target = 
(NullCoalescingOperator) t;
+
+                               target.left = left.Clone (clonectx);
+                               target.right = right.Clone (clonectx);
+                       }
                }
 
                public class LiftedUnaryMutator : ExpressionStatement

Added: trunk/mcs/tests/gtest-anon-19.cs
===================================================================
--- trunk/mcs/tests/gtest-anon-19.cs    2007-12-15 04:46:07 UTC (rev 91347)
+++ trunk/mcs/tests/gtest-anon-19.cs    2007-12-15 05:08:06 UTC (rev 91348)
@@ -0,0 +1,27 @@
+// Compiler options: -langversion:linq
+
+// Test case for bug: #349034
+
+using System;
+using System.Collections.Generic;
+using System.Text.RegularExpressions;
+
+class Test {
+        private static void TestNaturalSort()
+        {
+            Comparison<string> naturalSortComparer = (left, right) => {
+                return Regex.Replace(left ?? "", @"([\d]+)|([^\d]+)", m =>
+(m.Value.Length > 0 && char.IsDigit(m.Value[0])) ?
+m.Value.PadLeft(Math.Max((left ?? "").Length, (right ?? "").Length)) :
+m.Value).CompareTo(Regex.Replace(right ?? "", @"([\d]+)|([^\d]+)", m =>
+(m.Value.Length > 0 && char.IsDigit(m.Value[0])) ?
+m.Value.PadLeft(Math.Max((left ?? "").Length, (right ?? "").Length)) :
+m.Value));
+            };
+        }
+
+        public static void Main ()
+        {
+                TestNaturalSort ();
+        }
+}


Property changes on: trunk/mcs/tests/gtest-anon-19.cs
___________________________________________________________________
Name: svn:eol-style
   + native

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to