edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/IronRuby.Tests/RubyTests.cs;C1013373
File: RubyTests.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/IronRuby.Tests/RubyTests.cs;C1013373  (server)    7/25/2009 9:33 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/IronRuby.Tests/RubyTests.cs;ToS
@@ -112,7 +112,6 @@
                 Strings9,
                 ToSConversion1,
                 ToSConversion2,
-                ClrToString1,
                 Inspect1,
                 Inspect2,
 
@@ -404,15 +403,16 @@
                 ClrConstructor1,
                 ClrConstructor2,
                 ClrConstructor3,
+                ClrConstructor4,
                 ClrPrimitiveNumericTypes1,
                 ClrArrays1,
                 ClrChar1,
                 ClrOperators1,
                 ClrOperators2,
                 ClrConversions1,
-                ClrHashEquals1,
-                ClrHashEquals2,
-                ClrHashEquals3,
+                ClrHashEqualsToString1,
+                ClrHashEqualsToString2,
+                ClrHashEqualsToString3,
                 ClrHashEquals4,
                 Scenario_RubyEngine1,
                 Scenario_RubyInteractive1,
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/IronRuby.Tests/Runtime/ClrTests.cs;C1000972
File: ClrTests.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/IronRuby.Tests/Runtime/ClrTests.cs;C1000972  (server)    7/25/2009 9:33 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/IronRuby.Tests/Runtime/ClrTests.cs;ToS
@@ -1578,7 +1578,7 @@
 
         public class ClassWithToStringHashEquals1 {
             public override string ToString() {
-                return "hello";
+                return "b";
             }
 
             public override int GetHashCode() {
@@ -1596,14 +1596,39 @@
             }
         }
 
-        public void ClrToString1() {
+        public void ClrHashEqualsToString1() {
+            Test_HashEqlToString("get_hash_code", "equals", "to_string");
+        }
+
+        public void ClrHashEqualsToString2() {
+            Test_HashEqlToString("GetHashCode", "Equals", "ToString");
+        }
+
+        public void ClrHashEqualsToString3() {
+            Test_HashEqlToString("hash", "eql?", "to_s");
+        }
+
+        private void Test_HashEqlToString(string/*!*/ hashMethodName, string/*!*/ equalsMethodName, string/*!*/ toStringMethodName) {
             Engine.Runtime.Globals.SetVariable("B", Context.GetClass(typeof(ClassWithToStringHashEquals1)));
 
-            var objs = Engine.Execute<RubyArray>(@"
+            var objs = Engine.Execute<RubyArray>(String.Format(@"
+class Object
+  # Object.to_string is not defined by default since Object is a built-in class, so let's alias it
+  alias to_string ToString
+end
+
 class C
-  def to_s
-    '123'
+  def {0}
+    789
   end
+
+  def {1}(other)
+    other == 1
+  end
+
+  def {2}
+    'c'
+  end
 end
 
 class D
@@ -1613,29 +1638,64 @@
 end
 
 class F < B
-  def to_s
-    'abc'
+  def {0}
+    1000
   end
+
+  def {1}(other)
+    other == 2
+  end
+
+  def {2}
+    'f'
+  end
 end
 
-[C.new, D.new, E.new, E.new.to_s, F.new]
-");
+[C.new, D.new, E.new, F.new, E.new.{0}, E.new.{1}(0), D.new.{2}, E.new.{2}]
+", hashMethodName, equalsMethodName, toStringMethodName));
 
-            Assert(objs[0].ToString() == "123");
+            object c = objs[0], d = objs[1], e = objs[2], f = objs[3];
+            object eHash = objs[4], eEquals = objs[5], dToString = objs[6], eToString = objs[7];
 
-            string s = objs[1].ToString();
+            int h = c.GetHashCode();
+            string s = c.ToString();
+            Assert(h == 789);
+            Assert(c.Equals(1));
+            Assert(s == "c");
+
+            h = d.GetHashCode();
+            s = d.ToString();
+            Assert(h == RuntimeHelpers.GetHashCode(objs[1]));
+            Assert(d.Equals(d) && !d.Equals(1));
             Assert(s.StartsWith("#<D:0x") && s.EndsWith(">"));
 
-            s = objs[2].ToString();
-            Assert(s == "hello");
+            h = e.GetHashCode();
+            s = e.ToString();
+            Assert(h == 1234);
+            Assert(e.Equals(0));
+            Assert(s == "b");
 
-            s = objs[3].ToString();
-            Assert(s == "hello");
+            h = f.GetHashCode();
+            s = f.ToString();
+            Assert(h == 1000);
+            Assert(f.Equals(2));
+            Assert(s == "f");
 
-            //TODO:
-            //s = objs[4].ToString();
-            //Assert(s == "abc");
+            Assert((int)eHash == 1234);
+            Assert((bool)eEquals);
 
+            string dToStringStr, eToStringStr;
+            if (toStringMethodName == "to_s") {
+                dToStringStr = ((MutableString)dToString).ToString();
+                eToStringStr = ((MutableString)eToString).ToString();
+            } else {
+                dToStringStr = (string)dToString;
+                eToStringStr = (string)eToString;
+            }
+            Assert(dToStringStr.StartsWith("#<D:0x") && dToStringStr.EndsWith(">"));
+            Assert(eToStringStr == "b");
+              
+            // special ToString cases:
             var range = new Range(1, 2, true);
             Assert(range.ToString() == "1...2");
 
@@ -1643,73 +1703,6 @@
             Assert(regex.ToString() == "(?mi-x:hello)");
         }
 
-        public void ClrHashEquals1() {
-            Test_HashClr("get_hash_code", "equals");
-        }
-
-        public void ClrHashEquals2() {
-            Test_HashClr("GetHashCode", "Equals");
-        }
-
-        public void ClrHashEquals3() {
-            Test_HashClr("hash", "eql?");
-        }
-
-        private void Test_HashClr(string/*!*/ hashMethodName, string/*!*/ equalsMethodName) {
-            Engine.Runtime.Globals.SetVariable("B", Context.GetClass(typeof(ClassWithToStringHashEquals1)));
-
-            var objs = Engine.Execute<RubyArray>(String.Format(@"
-class C
-  def {0}
-    789
-  end
-
-  def {1}(other)
-    other == 1
-  end
-end
-
-class D
-end
-
-class E < B
-end
-
-class F < B
-  def {0}
-    1000
-  end
-
-  def {1}(other)
-    other == 2
-  end
-end
-
-[C.new, D.new, E.new, F.new, E.new.{0}, E.new.{1}(0)]
-", hashMethodName, equalsMethodName));
-
-            object c = objs[0], d = objs[1], e = objs[2], f = objs[3], eHash = objs[4], eEquals = objs[5];
-
-            int h = c.GetHashCode();
-            Assert(h == 789);
-            Assert(objs[0].Equals(1));
-
-            h = d.GetHashCode();
-            Assert(h == RuntimeHelpers.GetHashCode(objs[1]));
-            Assert(d.Equals(d) && !d.Equals(1));
-
-            h = e.GetHashCode();
-            Assert(h == 1234);
-            Assert(e.Equals(0));
-
-            h = f.GetHashCode();
-            Assert(h == 1000);
-            Assert(f.Equals(2));
-
-            Assert((int)eHash == 1234);
-            Assert((bool)eEquals);
-        }
-
         public void ClrHashEquals4() {
             var e = new RubyObject(Context.ObjectClass);
             int h;
@@ -1952,6 +1945,17 @@
 ", OutputFlags.Match);
         }
 
+        public class ClassWithInitialize {
+            public void Initialize(string z) {
+                throw new Exception();
+            }
+        }
+
+        public void ClrConstructor4() {
+            Context.ObjectClass.SetConstant("C", Context.GetClass(typeof(ClassWithInitialize)));
+            Engine.Execute(@"class D < C; new; end");
+        }
+
         #endregion
 
         #region CLR Primitive Types: Numeric, Arrays, Char, Enums
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Initializers.Generated.cs;C1019779
File: Initializers.Generated.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Initializers.Generated.cs;C1019779  (server)    7/25/2009 9:33 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Initializers.Generated.cs;ToS
@@ -2990,8 +2990,8 @@
             );
             
             module.DefineLibraryMethod("to_s", 0x51, 
-                new System.Func<IronRuby.Runtime.RubyContext, System.Object, IronRuby.Builtins.MutableString>(IronRuby.Builtins.KernelOps.ToS), 
-                new System.Func<IronRuby.Builtins.RubyObject, IronRuby.Builtins.MutableString>(IronRuby.Builtins.KernelOps.ToS)
+                new System.Func<IronRuby.Runtime.IRubyObject, IronRuby.Builtins.MutableString>(IronRuby.Builtins.KernelOps.ToS), 
+                new System.Func<System.Object, IronRuby.Builtins.MutableString>(IronRuby.Builtins.KernelOps.ToS)
             );
             
             #if !SILVERLIGHT
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/KernelOps.cs;C1019779
File: KernelOps.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/KernelOps.cs;C1019779  (server)    7/25/2009 9:33 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/KernelOps.cs;ToS
@@ -1076,7 +1076,7 @@
 
         #region Public Instance Methods
 
-        #region ==, ===, =~, eql?, equal?, hash
+        #region ==, ===, =~, eql?, equal?, hash, to_s, inspect, to_a
 
         [RubyMethod("=~")]
         public static bool Match(object self, object other) {
@@ -1128,6 +1128,45 @@
             return false;
         }
 
+        [RubyMethod("to_s")]
+        public static MutableString/*!*/ ToS([NotNull]IRubyObject/*!*/ self) {
+            return RubyObject.BaseToMutableString(self);
+        }
+
+        [RubyMethod("to_s")]
+        public static MutableString/*!*/ ToS(object self) {
+            return self == null ? MutableString.CreateEmpty() : MutableString.Create(self.ToString());
+        }
+
+        /// <summary>
+        /// Returns a string containing a human-readable representation of obj.
+        /// If not overridden, uses the to_s method to generate the string. 
+        /// </summary>
+        [RubyMethod("inspect")]
+        public static MutableString/*!*/ Inspect(UnaryOpStorage/*!*/ inspectStorage, ConversionStorage<MutableString>/*!*/ tosConversion,
+            object self)
+        {
+
+            var context = tosConversion.Context;
+            if (context.HasInstanceVariables(self))
+            {
+                return RubyUtils.InspectObject(inspectStorage, tosConversion, self);
+            }
+            else
+            {
+                var site = tosConversion.GetSite(ConvertToSAction.Make(context));
+                return site.Target(site, self);
+            }
+        }
+
+        [RubyMethod("to_a")]
+        public static RubyArray/*!*/ ToA(RubyContext/*!*/ context, object self)
+        {
+            RubyArray result = new RubyArray();
+            result.Add(self);
+            return context.TaintObjectBy(result, self);
+        }
+
         #endregion
 
         #region __id__, id, object_id, class
@@ -1599,50 +1638,6 @@
 
         #endregion
 
-        #region inspect, to_s
-
-        /// <summary>
-        /// Returns a string containing a human-readable representation of obj.
-        /// If not overridden, uses the to_s method to generate the string. 
-        /// </summary>
-        [RubyMethod("inspect")]
-        public static MutableString/*!*/ Inspect(UnaryOpStorage/*!*/ inspectStorage, ConversionStorage<MutableString>/*!*/ tosConversion, 
-            object self) {
-
-            var context = tosConversion.Context;
-            if (context.HasInstanceVariables(self)) {
-                return RubyUtils.InspectObject(inspectStorage, tosConversion, self);
-            } else {
-                var site = tosConversion.GetSite(ConvertToSAction.Make(context));
-                return site.Target(site, self);
-            }
-        }
-
-        [RubyMethod("to_s")]
-        public static MutableString/*!*/ ToS(RubyContext/*!*/ context, [NotNull]object/*!*/ self) {
-            if (self.GetType() == typeof(object)) {
-                return RubyUtils.ObjectToMutableString(context, self);
-            }
-
-            // maps to CLR's ToString:
-            return MutableString.Create(self.ToString()).TaintBy(self, context);
-        }
-
-        [RubyMethod("to_s")]
-        public static MutableString/*!*/ ToS([NotNull]RubyObject/*!*/ self) {
-            // default representation #<{class-name}: {object-id}> 
-            return self.ToMutableString();
-        }
-
-        [RubyMethod("to_a")]
-        public static RubyArray/*!*/ ToA(RubyContext/*!*/ context, object self) {
-            RubyArray result = new RubyArray();
-            result.Add(self);
-            return context.TaintObjectBy(result, self);
-        }
-
         #endregion
-
-        #endregion
     }
 }
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Builtins/MutableString.cs;C977140
File: MutableString.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Builtins/MutableString.cs;C977140  (server)    7/25/2009 9:33 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Builtins/MutableString.cs;ToS
@@ -516,15 +516,23 @@
         }
 
         /// <summary>
-        /// Makes this string tainted if the specified string is tainted.
+        /// Makes this string tainted if the specified object is tainted.
         /// </summary>
+        public MutableString/*!*/ TaintBy(IRubyObjectState/*!*/ obj) {
+            IsTainted |= obj.IsTainted;
+            return this;
+        }
+
+        /// <summary>
+        /// Makes this string tainted if the specified object is tainted.
+        /// </summary>
         public MutableString/*!*/ TaintBy(object/*!*/ obj, RubyContext/*!*/ context) {
             IsTainted |= context.IsObjectTainted(obj);
             return this;
         }
 
         /// <summary>
-        /// Makes this string tainted if the specified string is tainted.
+        /// Makes this string tainted if the specified object is tainted.
         /// </summary>
         public MutableString/*!*/ TaintBy(object/*!*/ obj, RubyScope/*!*/ scope) {
             IsTainted |= scope.RubyContext.IsObjectTainted(obj);
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyClass.cs;C1015956
File: RubyClass.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyClass.cs;C1015956  (server)    7/25/2009 9:33 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyClass.cs;ToS
@@ -101,6 +101,7 @@
         private CallSite<Func<CallSite, object, MutableString>> _stringConversionSite;
         private CallSite<Func<CallSite, object, object, object>> _eqlSite;
         private CallSite<Func<CallSite, object, object>> _hashSite;
+        private CallSite<Func<CallSite, object, object>> _toStringSite;
 
         public CallSite<Func<CallSite, object, object>>/*!*/ InspectSite { 
             get { return RubyUtils.GetCallSite(ref _inspectSite, Context, "inspect", 0); } 
@@ -125,6 +126,14 @@
                 );
             }
         }
+
+        public CallSite<Func<CallSite, object, object>>/*!*/ ToStringSite {
+            get {
+                return RubyUtils.GetCallSite(ref _toStringSite, Context, "ToString",
+                    new RubyCallSignature(0, RubyCallFlags.HasImplicitSelf | RubyCallFlags.IsVirtualCall)
+                );
+            }
+        }
         
         // RubyClass, RubyClass -> object
         private CallSite<Func<CallSite, object, object, object>> _classInheritedCallbackSite;
@@ -1210,7 +1219,7 @@
             }
 
             bool hasRubyInitializer = initializer is RubyMethodInfo;
-            bool hasLibraryInitializer = !hasRubyInitializer && initializer.DeclaringModule != Context.ObjectClass;
+            bool hasLibraryInitializer = !hasRubyInitializer && initializer.DeclaringModule != Context.ObjectClass && initializer is RubyLibraryMethodInfo;
 
             if (hasRubyInitializer || hasLibraryInitializer && _isRubyClass) {
                 // allocate and initialize:
@@ -1315,6 +1324,10 @@
         public bool BuildAllocatorCall(MetaObjectBuilder/*!*/ metaBuilder, CallArguments/*!*/ args, Func<Expression>/*!*/ defaultExceptionMessage) {
             Type type = GetUnderlyingSystemType();
 
+            if (type == typeof(object)) {
+                type = typeof(RubyObject);
+            }
+
             if (_structInfo != null) {
                 metaBuilder.Result = Methods.AllocateStructInstance.OpCall(AstUtils.Convert(args.TargetExpression, typeof(RubyClass)));
                 return true;
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyModule.cs;C1015956
File: RubyModule.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyModule.cs;C1015956  (server)    7/25/2009 9:33 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyModule.cs;ToS
@@ -699,6 +699,10 @@
             return base.Equals(other);
         }
 
+        public string/*!*/ BaseToString() {
+            return base.ToString();
+        }
+
         #endregion
 
         #region Factories (thread-safe)
@@ -1648,12 +1652,14 @@
                 }
 
                 // Special mappings:
-                // Do not map to Kernel#hash/eql? to prevent recursion in case Object.GetHashCode/Equals is removed.
+                // Do not map to Kernel#hash/eql?/to_s to prevent recursion in case Object.GetHashCode/Equals/ToString is removed.
                 if (this != Context.KernelModule) {
                     if (name == "GetHashCode" && TryGetDefinedMethod("hash", out method) && method.IsRubyMember) {
                         return true;
                     } else if (name == "Equals" && TryGetDefinedMethod("eql?", out method) && method.IsRubyMember) {
                         return true;
+                    } if (name == "ToString" && TryGetDefinedMethod("to_s", out method) && method.IsRubyMember) {
+                        return true;
                     }
                 }
             }
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyObject.cs;C1015956
File: RubyObject.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyObject.cs;C1015956  (server)    7/25/2009 9:33 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyObject.cs;ToS
@@ -47,14 +47,40 @@
         public override string/*!*/ ToString() {
 #if DEBUG && !SILVERLIGHT && !SYSTEM_CORE
             if (RubyBinder._DumpingExpression) {
-                return ToMutableString().ToString();
+                return BaseToMutableString(this).ToString();
             }
 #endif
-            // Translate ToString to to_s conversion for .NET callers.
-            var site = _immediateClass.StringConversionSite;
-            return site.Target(site, this).ToString();
+            var site = _immediateClass.ToStringSite;
+            object toStringResult = site.Target(site, this);
+            if (ReferenceEquals(toStringResult, RubyOps.ForwardToBase)) {
+                return BaseToString();
+            }
+
+            string str = toStringResult as string;
+            if (str != null) {
+                return str;
+            }
+
+            var mstr = toStringResult as MutableString ?? RubyUtils.ObjectToMutableString(_immediateClass.Context, toStringResult);
+            return mstr.ToString();
         }
 
+        public string/*!*/ BaseToString() {
+            return ToMutableString(this).ToString();
+        }
+
+        public static MutableString/*!*/ ToMutableString(IRubyObject/*!*/ self) {
+            return RubyUtils.FormatObject(self.ImmediateClass.GetNonSingletonClass().Name, self.GetInstanceData().ObjectId, self.IsTainted);
+        }
+
+        public static MutableString/*!*/ BaseToMutableString(IRubyObject/*!*/ self) {
+            if (self is RubyObject) {
+                return ToMutableString(self);
+            } else {
+                return MutableString.CreateMutable(self.BaseToString());
+            }
+        }
+
         public override bool Equals(object other) {
             if (ReferenceEquals(this, other)) {
                 // Handle this directly here. Otherwise it can cause infinite recurion when running
@@ -89,10 +115,6 @@
             return base.GetHashCode();
         }
 
-        public MutableString/*!*/ ToMutableString() {
-            return RubyUtils.FormatObject(_immediateClass.GetNonSingletonClass().Name, GetInstanceData().ObjectId, IsTainted);
-        }
-
         public MutableString/*!*/ Inspect() {
             return _immediateClass.Context.Inspect(this);
         }
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Builtins/Subclasses.Generated.cs;C1015956
File: Subclasses.Generated.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Builtins/Subclasses.Generated.cs;C1015956  (server)    7/25/2009 9:33 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Builtins/Subclasses.Generated.cs;ToS
@@ -80,6 +80,10 @@
             public bool BaseEquals(object other) {
                 return base.Equals(other);
             }
+
+            public string/*!*/ BaseToString() {
+                return base.ToString();
+            }
         }
     }
 #endif
@@ -131,6 +135,10 @@
             public bool BaseEquals(object other) {
                 return base.Equals(other);
             }
+
+            public string/*!*/ BaseToString() {
+                return base.ToString();
+            }
         }
     }
     public partial class Proc {
@@ -180,6 +188,10 @@
             public bool BaseEquals(object other) {
                 return base.Equals(other);
             }
+
+            public string/*!*/ BaseToString() {
+                return base.ToString();
+            }
         }
     }
     public partial class Range {
@@ -229,6 +241,10 @@
             public bool BaseEquals(object other) {
                 return base.Equals(other);
             }
+
+            public string/*!*/ BaseToString() {
+                return base.ToString();
+            }
         }
     }
     public partial class RubyRegex {
@@ -278,6 +294,10 @@
             public bool BaseEquals(object other) {
                 return base.Equals(other);
             }
+
+            public string/*!*/ BaseToString() {
+                return base.ToString();
+            }
         }
     }
 #endregion
@@ -330,6 +350,10 @@
             public bool BaseEquals(object other) {
                 return base.Equals(other);
             }
+
+            public string/*!*/ BaseToString() {
+                return base.ToString();
+            }
         }
     }
 #endif
@@ -368,6 +392,10 @@
             public bool BaseEquals(object other) {
                 return base.Equals(other);
             }
+
+            public string/*!*/ BaseToString() {
+                return base.ToString();
+            }
         }
     }
 #endregion
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Compiler/ReflectionCache.Generated.cs;C999418
File: ReflectionCache.Generated.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Compiler/ReflectionCache.Generated.cs;C999418  (server)    7/25/2009 9:33 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Compiler/ReflectionCache.Generated.cs;ToS
@@ -85,8 +85,6 @@
         private static MethodInfo _CreateDelegateFromMethod;
         public static MethodInfo/*!*/ CreateDelegateFromProc { get { return _CreateDelegateFromProc ?? (_CreateDelegateFromProc = GetMethod(typeof(RubyOps), "CreateDelegateFromProc")); } }
         private static MethodInfo _CreateDelegateFromProc;
-        public static MethodInfo/*!*/ CreateEmptyStrongBox { get { return _CreateEmptyStrongBox ?? (_CreateEmptyStrongBox = GetMethod(typeof(RubyOps), "CreateEmptyStrongBox")); } }
-        private static MethodInfo _CreateEmptyStrongBox;
         public static MethodInfo/*!*/ CreateEncoding { get { return _CreateEncoding ?? (_CreateEncoding = GetMethod(typeof(RubyOps), "CreateEncoding")); } }
         private static MethodInfo _CreateEncoding;
         public static MethodInfo/*!*/ CreateEvent { get { return _CreateEvent ?? (_CreateEvent = GetMethod(typeof(RubyOps), "CreateEvent")); } }
@@ -99,8 +97,6 @@
         private static MethodInfo _CreateInclusiveIntegerRange;
         public static MethodInfo/*!*/ CreateInclusiveRange { get { return _CreateInclusiveRange ?? (_CreateInclusiveRange = GetMethod(typeof(RubyOps), "CreateInclusiveRange")); } }
         private static MethodInfo _CreateInclusiveRange;
-        public static MethodInfo/*!*/ CreateInitializedStrongBox { get { return _CreateInitializedStrongBox ?? (_CreateInitializedStrongBox = GetMethod(typeof(RubyOps), "CreateInitializedStrongBox")); } }
-        private static MethodInfo _CreateInitializedStrongBox;
         public static MethodInfo/*!*/ CreateMethodScope { get { return _CreateMethodScope ?? (_CreateMethodScope = GetMethod(typeof(RubyOps), "CreateMethodScope")); } }
         private static MethodInfo _CreateMethodScope;
         public static MethodInfo/*!*/ CreateModuleScope { get { return _CreateModuleScope ?? (_CreateModuleScope = GetMethod(typeof(RubyOps), "CreateModuleScope")); } }
@@ -275,6 +271,8 @@
         private static MethodInfo _IRubyObject_BaseEquals;
         public static MethodInfo/*!*/ IRubyObject_BaseGetHashCode { get { return _IRubyObject_BaseGetHashCode ?? (_IRubyObject_BaseGetHashCode = GetMethod(typeof(IRubyObject), "BaseGetHashCode")); } }
         private static MethodInfo _IRubyObject_BaseGetHashCode;
+        public static MethodInfo/*!*/ IRubyObject_BaseToString { get { return _IRubyObject_BaseToString ?? (_IRubyObject_BaseToString = GetMethod(typeof(IRubyObject), "BaseToString")); } }
+        private static MethodInfo _IRubyObject_BaseToString;
         public static MethodInfo/*!*/ IRubyObject_get_ImmediateClass { get { return _IRubyObject_get_ImmediateClass ?? (_IRubyObject_get_ImmediateClass = GetMethod(typeof(IRubyObject), "get_ImmediateClass")); } }
         private static MethodInfo _IRubyObject_get_ImmediateClass;
         public static MethodInfo/*!*/ IRubyObject_GetInstanceData { get { return _IRubyObject_GetInstanceData ?? (_IRubyObject_GetInstanceData = GetMethod(typeof(IRubyObject), "GetInstanceData")); } }
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Compiler/Generation/RubyTypeBuilder.cs;C1015956
File: RubyTypeBuilder.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Compiler/Generation/RubyTypeBuilder.cs;C1015956  (server)    7/25/2009 9:33 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Compiler/Generation/RubyTypeBuilder.cs;ToS
@@ -357,9 +357,9 @@
             il.EmitCall(Methods.SetObjectTaint);
             il.Emit(OpCodes.Ret);
 
-            // TODO: can we merge this with #base#GetHashCode/Equals?
+            // TODO: can we merge this with #base#GetHashCode/Equals/ToString?
 
-            // int IRubyObject.BaseGetHashCode() { return base.GetHashCode; }
+            // int IRubyObject.BaseGetHashCode() { return base.GetHashCode(); }
             il = DefineMethodOverride(_tb, Methods.IRubyObject_BaseGetHashCode);
             il.EmitLoadArg(0);
             il.EmitCall(_tb.BaseType.GetMethod("GetHashCode", Type.EmptyTypes));
@@ -371,6 +371,12 @@
             il.EmitLoadArg(1);
             il.EmitCall(_tb.BaseType.GetMethod("Equals", new[] { typeof(object) }));
             il.Emit(OpCodes.Ret);
+
+            // string IRubyObject.BaseToString() { return base.ToString(); }
+            il = DefineMethodOverride(_tb, Methods.IRubyObject_BaseToString);
+            il.EmitLoadArg(0);
+            il.EmitCall(_tb.BaseType.GetMethod("ToString", Type.EmptyTypes));
+            il.Emit(OpCodes.Ret);
         }
 
         private void DefineSerializer() {
===================================================================
