edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/IronRuby.Tests/RubyTests.cs;C926894
File: RubyTests.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/IronRuby.Tests/RubyTests.cs;C926894  (server)    6/2/2009 11:38 AM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/IronRuby.Tests/RubyTests.cs;VisibilityFixes1
@@ -446,15 +446,21 @@
                 MethodAdded1,
                 MethodLookup1,
                 Visibility1,
-                Visibility2,
+                Visibility2A,
+                Visibility2B,
+                Visibility2C,
                 Visibility3,
                 Visibility4,
                 VisibilityCaching1,
                 VisibilityCaching2,
                 DefineMethodVisibility1,
+                DefineMethodVisibility2A,
+                DefineMethodVisibility2B,
                 AliasedMethodVisibility1,
+                AttributeAccessorsVisibility1,
                 ModuleFunctionVisibility1,
                 ModuleFunctionVisibility2,
+
                 MethodDefinitionInDefineMethod1A,
                 MethodDefinitionInDefineMethod1B,
                 MethodDefinitionInDefineMethod2A,
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/IronRuby.Tests/Runtime/MethodTests.cs;C860162
File: MethodTests.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/IronRuby.Tests/Runtime/MethodTests.cs;C860162  (server)    6/2/2009 11:38 AM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/IronRuby.Tests/Runtime/MethodTests.cs;VisibilityFixes1
@@ -566,8 +566,8 @@
         /// <summary>
         /// public/private/protected define a super-forwarder - a method that calls super.
         /// </summary>
-        public void Visibility2() {
-            AssertOutput(() => CompilerTest(@"
+        public void Visibility2A() {
+            TestOutput(@"
 class A
   private
   def foo
@@ -596,12 +596,85 @@
 end
 
 C.new.foo
-"), @"
+", @"
 #<UnboundMethod: C(A)#foo>
 B::foo
 ");
         }
 
+        public void Visibility2B() {
+            TestOutput(@"
+module M 
+  def foo; puts 'ok'; end
+end
+
+class A
+  include M
+  private :foo
+end
+
+class B < A
+  include M
+  public :foo
+end
+
+B.new.foo
+", @"
+ok
+");
+
+            TestOutput(@"
+module N 
+  def foo; puts 'ok'; end
+end
+
+class D
+  include N
+  private :foo
+  public :foo
+end
+
+D.new.foo
+", @"
+ok
+");
+        }
+
+        public void Visibility2C() {
+            TestOutput(@"
+module M
+  private
+  def foo; puts 1; end
+end
+
+module N 
+  include M
+  public :foo               # defines a public super-forwarder that remembers to forward to 'foo'
+end
+
+module O
+  include N                         
+  alias bar foo             # stores N#foo public super-forwarder under name 'bar' to O's m-table
+  module_function :foo      # defines a module-function that is a copy of M#foo, not N#foo super-forwarder
+end
+
+module M
+  def foo; puts 2; end           
+end
+
+O.foo                       # this works, hence m-f foo is a copy of the real method
+
+class C 
+  include O
+end
+C.new.bar                   # invokes the new M#foo method - alias didn't make a copy of original M#foo and super-forwarder forwards to 'foo'
+", @"
+1
+2
+");
+
+        }
+        
         /// <summary>
         /// Protected visibility and singletons.
         /// </summary>
@@ -731,7 +804,7 @@
 
 class B < A
   private
-  define_method(:foo, instance_method(:foo))
+  define_method(:foo, instance_method(:foo)) 
 end
 
 B.new.foo rescue p $!
@@ -747,6 +820,47 @@
 ", OutputFlags.Match);
         }
 
+        [Options(Compatibility = RubyCompatibility.Ruby18)]
+        public void DefineMethodVisibility2A() {
+            Test_DefineMethodVisibility2();
+        }
+
+        [Options(Compatibility = RubyCompatibility.Ruby19)]
+        public void DefineMethodVisibility2B() {
+            Test_DefineMethodVisibility2();
+        }
+
+        public void Test_DefineMethodVisibility2() {
+            TestOutput(@"
+module M                                              # the inner module is the same module we call define_method on
+  1.times do  
+    module_function
+    M.send :define_method, :a, lambda { }              
+    private
+    M.send :define_method, :b, lambda { }              
+  end
+end
+
+module N                                               # the inner module different from the one we call define_method on
+  1.times do  
+    module_function
+    M.send :define_method, :c, lambda { }              
+    private
+    M.send :define_method, :d, lambda { }               
+  end
+end
+
+p M.public_instance_methods(false).collect { |m| m.to_s }.sort
+p M.private_instance_methods(false).collect { |m| m.to_s }.sort
+", Context.RubyOptions.Compatibility == RubyCompatibility.Ruby18 ? @"
+[""c"", ""d""]
+[""a"", ""b""]
+" : @"
+[""a"", ""b"", ""c"", ""d""]
+[]
+");
+        }
+
         /// <summary>
         /// alias, alias_method ignore the current scope visibility flags and copy methods with their visibility unmodified.
         /// </summary>
@@ -788,6 +902,23 @@
 [""a_pri"", ""am_pri""]
 ");
         }
+
+        public void AttributeAccessorsVisibility1() {
+            TestOutput(@"
+class C
+  1.times {                                       # we need to use visibility flags of the module scope
+    private
+    attr_accessor :foo
+  }   
+ 
+  m = private_instance_methods(false)
+  p m.include?('foo'), m.include?('foo=')
+end
+", @"
+true
+true
+");
+        }
         
         private string MethodDefinitionInDefineMethodCode1 = @"
 class A
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/ModuleOps.cs;C889829
File: ModuleOps.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/ModuleOps.cs;C889829  (server)    6/2/2009 11:30 AM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/ModuleOps.cs;VisibilityFixes1
@@ -260,7 +260,12 @@
 
                 // we need to define new methods one by one since the method_added events can define a new method that might be used here:
                 using (context.ClassHierarchyLocker()) {
-                    method = module.ResolveMethodFallbackToObjectNoLock(methodName, RubyClass.IgnoreVisibility).Info;
+                    MethodLookup options = MethodLookup.FallbackToObject;
+                    if (!isModuleFunction) {
+                        options |= MethodLookup.ReturnForwarder;
+                    }
+
+                    method = module.ResolveMethodNoLock(methodName, RubyClass.IgnoreVisibility, options).Info;
                     if (method == null) {
                         throw RubyExceptions.CreateNameError(RubyExceptions.FormatMethodMissingMessage(context, module, methodName));
                     }
@@ -310,11 +315,7 @@
         private static void DefineMethod(RubyScope/*!*/ scope, RubyModule/*!*/ self, string/*!*/ methodName, RubyMemberInfo/*!*/ info,
             RubyModule/*!*/ targetConstraint) {
 
-            // MRI: doesn't create a singleton method if module_function is used in the scope, however the the private visibility is applied
-            var attributesScope = scope.GetMethodAttributesDefinitionScope();
-            bool isModuleFunction = (attributesScope.MethodAttributes & RubyMethodAttributes.ModuleFunction) == RubyMethodAttributes.ModuleFunction;
-            var visibility = isModuleFunction ? RubyMethodVisibility.Private : attributesScope.Visibility;
-
+            var visibility = GetDefinedMethodVisibility(scope, self, methodName);
             using (self.Context.ClassHierarchyLocker()) {
                 // MRI 1.8 does the check when the method is called, 1.9 checks it upfront as we do:
                 if (!self.HasAncestorNoLock(targetConstraint)) {
@@ -342,15 +343,32 @@
         public static Proc/*!*/ DefineMethod(RubyScope/*!*/ scope, RubyModule/*!*/ self, 
             [DefaultProtocol, NotNull]string/*!*/ methodName, [NotNull]Proc/*!*/ method) {
 
-            // MRI: ignores ModuleFunction scope flag (doesn't create singleton method).
-            // MRI 1.8: uses private visibility if module_function is applied (bug).
-            // MFI 1.9: uses public visibility as we do, unless the name is special.
-            var visibility = RubyUtils.GetSpecialMethodVisibility(scope.Visibility, methodName);
-
+            var visibility = GetDefinedMethodVisibility(scope, self, methodName);
             self.AddMethod(scope.RubyContext, methodName, Proc.ToLambdaMethodInfo(method.ToLambda(), methodName, visibility, self));
             return method;
         }
 
+        private static RubyMethodVisibility GetDefinedMethodVisibility(RubyScope/*!*/ scope, RubyModule/*!*/ module, string/*!*/ methodName) {
+            // MRI: Special names are private.
+            // MRI: Doesn't create a singleton method if module_function is used in the scope, however the private visibility is applied (bug?)
+            // MRI 1.8: uses the current scope's visibility only if the target module is the same as the scope's module (bug?)
+            // MFI 1.9: always uses public visibility (bug?)
+            RubyMethodVisibility visibility;
+            if (scope.RubyContext.RubyOptions.Compatibility == RubyCompatibility.Ruby18) {
+                var attributesScope = scope.GetMethodAttributesDefinitionScope();
+                if (attributesScope.GetInnerMostModuleForMethodLookup() == module) {
+                    bool isModuleFunction = (attributesScope.MethodAttributes & RubyMethodAttributes.ModuleFunction) == RubyMethodAttributes.ModuleFunction;
+                    visibility = (isModuleFunction) ? RubyMethodVisibility.Private : attributesScope.Visibility;
+                } else {
+                    visibility = RubyMethodVisibility.Public;
+                }
+            } else {
+                visibility = RubyMethodVisibility.Public;
+            }
+
+            return RubyUtils.GetSpecialMethodVisibility(visibility, methodName);
+        }
+
         #endregion
 
         #region method_(added|removed|undefined)
@@ -378,14 +396,15 @@
             // MRI: ignores ModuleFunction scope flag (doesn't create singleton methods):
 
             var varName = "@" + name;
+            var attributesScope = scope.GetMethodAttributesDefinitionScope();
 
             if (readable) {
-                var flags = (RubyMemberFlags)RubyUtils.GetSpecialMethodVisibility(scope.Visibility, name);
+                var flags = (RubyMemberFlags)RubyUtils.GetSpecialMethodVisibility(attributesScope.Visibility, name);
                 self.SetLibraryMethod(name, new RubyAttributeReaderInfo(flags, self, varName), false);
             }
             
             if (writable) {
-                self.SetLibraryMethod(name + "=", new RubyAttributeWriterInfo((RubyMemberFlags)scope.Visibility, self, varName), false);
+                self.SetLibraryMethod(name + "=", new RubyAttributeWriterInfo((RubyMemberFlags)attributesScope.Visibility, self, varName), false);
             }
         }
 
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Ruby.csproj;C925471
File: Ruby.csproj
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Ruby.csproj;C925471  (server)    6/2/2009 1:10 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Ruby.csproj;VisibilityFixes1
@@ -184,6 +184,7 @@
     <Compile Include="Runtime\Calls\RubyMethodGroupBase.cs" />
     <Compile Include="Runtime\Calls\RubyOverloadGroupInfo.cs" />
     <Compile Include="Runtime\Calls\RubyOverloadResolver.cs" />
+    <Compile Include="Runtime\Calls\SuperForwarderInfo.cs" />
     <Compile Include="Runtime\Calls\VersionHandle.cs" />
     <Compile Include="Runtime\CheckedMonitor.cs" />
     <Compile Include="Runtime\CustomTypeDescHelpers.cs" />
@@ -377,4 +378,4 @@
   </Target>
   <Target Name="AfterBuild">
   </Target>
-</Project>
+</Project>
\ No newline at end of file
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyClass.cs;C926894
File: RubyClass.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyClass.cs;C926894  (server)    6/2/2009 11:28 AM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyClass.cs;VisibilityFixes1
@@ -576,11 +576,6 @@
             return result;
         }
 
-        public override MethodResolutionResult ResolveMethodFallbackToObjectNoLock(string/*!*/ name, RubyClass visibilityContext) {
-            // Note: all classes include Object in ancestors, so we don't need to search there.
-            return ResolveMethodNoLock(name, visibilityContext);
-        }
-
         internal RubyMemberInfo ResolveMethodMissingForSite(string/*!*/ name, RubyMethodVisibility incompatibleVisibility) {
             Context.RequiresClassHierarchyLock();
             var methodMissing = ResolveMethodForSiteNoLock(Symbols.MethodMissing, null);
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyModule.cs;C922537
File: RubyModule.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyModule.cs;C922537  (server)    6/2/2009 11:06 AM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyModule.cs;VisibilityFixes1
@@ -61,6 +61,14 @@
         IsSelfContained = 0x100,
     }
 
+    [Flags]
+    public enum MethodLookup {
+        Default = 0,
+        Virtual = 1,
+        ReturnForwarder = 2,
+        FallbackToObject = 4,
+    }
+
     // TODO: freezing
 #if DEBUG
     [DebuggerDisplay("{DebugName}")]
@@ -1110,7 +1118,8 @@
 
             RubyMemberInfo method;
             using (Context.ClassHierarchyLocker()) {
-                method = ResolveMethodFallbackToObjectNoLock(oldName, RubyClass.IgnoreVisibility).Info;
+                // MRI: aliases a super-forwarder not the real method.
+                method = ResolveMethodNoLock(oldName, RubyClass.IgnoreVisibility, MethodLookup.FallbackToObject | MethodLookup.ReturnForwarder).Info;
                 if (method == null) {
                     throw RubyExceptions.CreateUndefinedMethodError(this, oldName);
                 }
@@ -1138,7 +1147,7 @@
             if (TryGetMethod(name, ref skipHidden, out existing)) {
                 SetMethodNoEventNoLock(callerContext, name, method.Copy((RubyMemberFlags)visibility, this));
             } else {
-                SetMethodNoEventNoLock(callerContext, name, new RubyMemberInfo((RubyMemberFlags)visibility | RubyMemberFlags.SuperForwarder, method.DeclaringModule));
+                SetMethodNoEventNoLock(callerContext, name, new SuperForwarderInfo((RubyMemberFlags)visibility, method.DeclaringModule, name));
             }
         }
 
@@ -1379,18 +1388,18 @@
         }
 
         public MethodResolutionResult ResolveMethodForSiteNoLock(string/*!*/ name, RubyClass visibilityContext) {
-            return ResolveMethodForSiteNoLock(name, visibilityContext, false);
+            return ResolveMethodForSiteNoLock(name, visibilityContext, MethodLookup.Default);
         }
 
-        internal MethodResolutionResult ResolveMethodForSiteNoLock(string/*!*/ name, RubyClass visibilityContext, bool virtualLookup) {
-            return ResolveMethodNoLock(name, visibilityContext, virtualLookup).InvalidateSitesOnOverride();
+        internal MethodResolutionResult ResolveMethodForSiteNoLock(string/*!*/ name, RubyClass visibilityContext, MethodLookup options) {
+            return ResolveMethodNoLock(name, visibilityContext, options).InvalidateSitesOnOverride();
         }
 
         public MethodResolutionResult ResolveMethodNoLock(string/*!*/ name, RubyClass visibilityContext) {
-            return ResolveMethodNoLock(name, visibilityContext, false);
+            return ResolveMethodNoLock(name, visibilityContext, MethodLookup.Default);
         }
 
-        internal MethodResolutionResult ResolveMethodNoLock(string/*!*/ name, RubyClass visibilityContext, bool virtualLookup) {
+        public MethodResolutionResult ResolveMethodNoLock(string/*!*/ name, RubyClass visibilityContext, MethodLookup options) {
             Context.RequiresClassHierarchyLock();
             Assert.NotNull(name);
 
@@ -1399,25 +1408,37 @@
             RubyModule owner = null;
             bool skipHidden = false;
             bool foundCallerSelf = false;
+            MethodResolutionResult result;
 
             if (ForEachAncestor((module) => {
                 owner = module;
                 foundCallerSelf |= module == visibilityContext;
-                return module.TryGetMethod(name, ref skipHidden, virtualLookup, out info);
+                return module.TryGetMethod(name, ref skipHidden, (options & MethodLookup.Virtual) != 0, out info);
             })) {
                 if (info == null || info.IsUndefined) {
-                    return MethodResolutionResult.NotFound;
+                    result = MethodResolutionResult.NotFound;
                 } else if (!IsMethodVisible(info, owner, visibilityContext, foundCallerSelf)) {
-                    return new MethodResolutionResult(info, owner, false);
+                    result = new MethodResolutionResult(info, owner, false);
                 } else if (info.IsSuperForwarder) {
-                    // start again with owner's super ancestor and ignore visibility:
-                    return owner.ResolveSuperMethodNoLock(name, owner);
+                    if ((options & MethodLookup.ReturnForwarder) != 0) {
+                        result = new MethodResolutionResult(info, owner, true);
+                    } else {
+                        // start again with owner's super ancestor and ignore visibility:
+                        result = owner.ResolveSuperMethodNoLock(((SuperForwarderInfo)info).SuperName, owner);
+                    }
                 } else {
-                    return new MethodResolutionResult(info, owner, true);
+                    result = new MethodResolutionResult(info, owner, true);
                 }
+            } else {
+                result = MethodResolutionResult.NotFound;
             }
 
-            return MethodResolutionResult.NotFound;
+            // Note: all classes include Object in ancestors, so we don't need to search it again:
+            if (!result.Found && (options & MethodLookup.FallbackToObject) != 0 && !IsClass) {
+                return _context.ObjectClass.ResolveMethodNoLock(name, visibilityContext, options & ~MethodLookup.FallbackToObject);
+            }
+
+            return result;
         }
 
         private bool IsMethodVisible(RubyMemberInfo/*!*/ method, RubyModule/*!*/ owner, RubyClass visibilityContext, bool foundCallerSelf) {
@@ -1439,15 +1460,6 @@
             return method.Visibility == RubyMethodVisibility.Public;
         }
 
-        /// <summary>
-        /// Resolve method and if it is not found in this module's ancestors, resolve in Object.
-        /// </summary>
-        public virtual MethodResolutionResult ResolveMethodFallbackToObjectNoLock(string/*!*/ name, RubyClass visibilityContext) {
-            Context.RequiresClassHierarchyLock();
-            var result = ResolveMethodNoLock(name, visibilityContext);
-            return result.Found ? result : _context.ObjectClass.ResolveMethodNoLock(name, visibilityContext);
-        }
-
         // skip one method in the method resolution order (MRO)
         public MethodResolutionResult ResolveSuperMethodNoLock(string/*!*/ name, RubyModule/*!*/ callerModule) {
             Context.RequiresClassHierarchyLock();
@@ -1604,11 +1616,15 @@
                         stop = !inherited;
                     }
 
-                } else if (member.IsUndefined) {
+                } else if (!visited.ContainsKey(name)) {
+                    // yield the member only if it has the right visibility:
+                    if (!member.IsUndefined && ((RubyMethodAttributes)member.Visibility & attributes) != 0) {
+                        action(name, member);
+                    }
+
+                    // visit the member even if it doesn't have the right visibility so that any overridden member with the right visibility
+                    // won't later be visited:
                     visited.Add(name, true);
-                } else if (((RubyMethodAttributes)member.Visibility & attributes) != 0 && !visited.ContainsKey(name)) {
-                    action(name, member);
-                    visited.Add(name, true);
                 }
 
                 return false;
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/MethodVisibility.cs;C761017
File: MethodVisibility.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/MethodVisibility.cs;C761017  (server)    6/2/2009 1:12 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/MethodVisibility.cs;VisibilityFixes1
@@ -81,10 +81,6 @@
 
         // used internally in RubyOps.DefineMethod
         ModuleFunction = 16,
-
-        // Used internally for implementation of methods defined by Kernel#public/protected/private.
-        // Such a method is just a stub that calls "super" - a method resolution thus forwards to its super method.
-        SuperForwarder = 32,
     }
 
     public enum RubyMethodVisibility {
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/Calls/RubyCallAction.cs;C922537
File: RubyCallAction.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/Calls/RubyCallAction.cs;C922537  (server)    6/2/2009 11:18 AM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/Calls/RubyCallAction.cs;VisibilityFixes1
@@ -244,7 +244,8 @@
             using (targetClass.Context.ClassHierarchyLocker()) {
                 metaBuilder.AddTargetTypeTest(args.Target, targetClass, args.TargetExpression, args.MetaContext);
 
-                method = targetClass.ResolveMethodForSiteNoLock(methodName, GetVisibilityContext(args.Signature, args.Scope), args.Signature.IsVirtualCall);
+                var options = args.Signature.IsVirtualCall ? MethodLookup.Virtual : MethodLookup.Default;
+                method = targetClass.ResolveMethodForSiteNoLock(methodName, GetVisibilityContext(args.Signature, args.Scope), options);
                 if (!method.Found) {
                     methodMissing = targetClass.ResolveMethodMissingForSite(methodName, method.IncompatibleVisibility);
                 } else {
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/Calls/RubyMemberInfo.cs;C916389
File: RubyMemberInfo.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/Calls/RubyMemberInfo.cs;C916389  (server)    6/2/2009 11:35 AM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/Calls/RubyMemberInfo.cs;VisibilityFixes1
@@ -94,8 +94,8 @@
             get { return (_flags & RubyMemberFlags.Empty) != 0; }
         }
 
-        internal bool IsSuperForwarder {
-            get { return (_flags & RubyMemberFlags.SuperForwarder) != 0; }
+        internal virtual bool IsSuperForwarder {
+            get { return false; }
         }
 
         /// <summary>
===================================================================
add: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/Calls/SuperForwarderInfo.cs
File: SuperForwarderInfo.cs
===================================================================
--- [no source file]
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/Calls/SuperForwarderInfo.cs;VisibilityFixes1
@@ -1,0 +1,54 @@
+?/* ****************************************************************************
+ *
+ * Copyright (c) Microsoft Corporation. 
+ *
+ * This source code is subject to terms and conditions of the Microsoft Public License. A 
+ * copy of the license can be found in the License.html file at the root of this distribution. If 
+ * you cannot locate the  Microsoft Public License, please send an email to 
+ * ironruby@microsoft.com. By using this source code in any fashion, you are agreeing to be bound 
+ * by the terms of the Microsoft Public License.
+ *
+ * You must not remove this notice, or any other, from this software.
+ *
+ *
+ * ***************************************************************************/
+
+using System;
+using System.Diagnostics;
+using System.Reflection;
+using Microsoft.Scripting.Actions;
+using Microsoft.Scripting.Runtime;
+using Microsoft.Scripting.Utils;
+using IronRuby.Builtins;
+
+namespace IronRuby.Runtime.Calls {
+    /// <summary>
+    /// Used internally for implementation of methods defined by Kernel#public/protected/private.
+    /// Such a method is just a stub that calls "super" - a method resolution thus forwards to its super method.
+    /// </summary>
+    internal sealed class SuperForwarderInfo : RubyMemberInfo {
+        // If the forwarder is aliased we need to know the super name of the method so that we can forward to it.
+        private readonly string _superName;
+
+        public SuperForwarderInfo(RubyMemberFlags flags, RubyModule/*!*/ declaringModule, string/*!*/ superName) 
+            : base(flags, declaringModule) {
+            _superName = superName;
+        }
+
+        internal override bool IsSuperForwarder {
+            get { return true; }
+        }
+
+        public string SuperName {
+            get { return _superName; }
+        }
+
+        internal protected override RubyMemberInfo Copy(RubyMemberFlags flags, RubyModule/*!*/ module) {
+            return new SuperForwarderInfo(flags, module, _superName);
+        }
+
+        public override string/*!*/ ToString() {
+            return base.ToString() + (_superName != null ? " forward to: " + _superName : null);
+        }
+    }
+}
===================================================================
