edit: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/IronRuby.Tests/RubyTests.cs;C1204880
File: RubyTests.cs
===================================================================
--- $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/IronRuby.Tests/RubyTests.cs;C1204880  (server)    10/9/2009 6:12 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/IronRuby.Tests/RubyTests.cs;ExplicitIfaces
@@ -424,8 +424,9 @@
                 ClrGenericMethods1,
                 ClrOverloadSelection1,
                 ClrOverloadSelection2,
+                ClrNewSlot1,
                 ClrInterfaces1,
-                ClrInterfaces2,
+                ClrExplicitInterfaces1,
                 ClrInclude1,
                 ClrNew1,
                 ClrNew2,
===================================================================
edit: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/IronRuby.Tests/Runtime/ClrTests.cs;C1204880
File: ClrTests.cs
===================================================================
--- $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/IronRuby.Tests/Runtime/ClrTests.cs;C1204880  (server)    10/9/2009 5:33 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/IronRuby.Tests/Runtime/ClrTests.cs;ExplicitIfaces
@@ -1064,6 +1064,43 @@
 ");
         }
 
+        public class ClassWithSlot1 {
+            public int Foo() {
+                return 1;
+            }
+
+            public override string ToString() {
+                return "base";
+            }
+        }
+
+        public class ClassWithNewSlot1 : ClassWithSlot1 {
+            public new string ToString() {
+                return "subclass";
+            }
+
+            public new int Foo() {
+                return 2;
+            }
+        }
+
+        public void ClrNewSlot1() {
+            Context.ObjectClass.SetConstant("NewSlot", Context.GetClass(typeof(ClassWithNewSlot1)));
+            Context.ObjectClass.SetConstant("Base", Context.GetClass(typeof(ClassWithSlot1)));
+            TestOutput(@"
+c = NewSlot.new
+p c.to_string
+p c.clr_member(Object, :to_string).call
+p c.foo
+p c.clr_member(Base, :foo).call
+", @"
+'subclass'
+'base'
+2
+1
+");
+        }
+
         #endregion
 
         #region Interfaces
@@ -1082,10 +1119,14 @@
 
         public interface InterfaceFoo2 {
             int Foo();
+            int this[int i] { get; }
+            event Action Evnt;
+            int EvntValue { get; }
         }
 
         public interface InterfaceBar1 {
             int Bar();
+            int Bar(int i);
         }
 
         public interface InterfaceBaz1 {
@@ -1102,19 +1143,31 @@
         }
 
         internal class InternalClass1 : InterfaceClassBase1, IEnumerable, IComparable, InterfaceBaz1, InterfaceFoo1, InterfaceFoo2, InterfaceBar1 {
+            int _evntValue;
+
             // simple:
-            public int Baz() { return 123; }
+            public int Baz() { return 0; }
 
             // simple explicit:
-            int IComparable.CompareTo(object obj) { return 0; }
+            int IComparable.CompareTo(object obj) { return 1; }
 
             // explicit + implicit
-            public int Bar() { return 0;}
-            int InterfaceBar1.Bar() { return 0; }
+            public int Bar() { return -1; }
+            int InterfaceBar1.Bar() { return 2; }
+            int InterfaceBar1.Bar(int i) { return 3; }
 
             // multiple explicit with the same signature 
-            int InterfaceFoo1.Foo() { return 1; }
-            int InterfaceFoo2.Foo() { return 2; }
+            int InterfaceFoo1.Foo() { return 4; }
+            int InterfaceFoo2.Foo() { return 5; }
+
+            // explicit default indexer:
+            int InterfaceFoo2.this[int i] { get { return 6; } }
+
+            // explicit property:
+            int InterfaceFoo2.EvntValue { get { return _evntValue; } }
+
+            // explicit event:
+            event Action InterfaceFoo2.Evnt { add { _evntValue++; } remove { _evntValue--; } }
         }
 
         public class ClassWithInterfaces2 : ClassWithInterfaces1, IComparable {
@@ -1148,24 +1201,37 @@
         /// Calling (explicit) interface methods on internal classes.
         /// A method that is accessible via any interface should be called. 
         /// If there is more than one then regular overload resolution should kick in.
-        /// 
         /// </summary>
-        public void ClrInterfaces2() {
+        public void ClrExplicitInterfaces1() {
             Context.ObjectClass.SetConstant("Inst", new InternalClass1());
             Context.ObjectClass.SetConstant("InterfaceFoo1", Context.GetModule(typeof(InterfaceFoo1)));
             Context.ObjectClass.SetConstant("InterfaceFoo2", Context.GetModule(typeof(InterfaceFoo2)));
             Context.ObjectClass.SetConstant("InterfaceBar1", Context.GetModule(typeof(InterfaceBar1)));
 
-            // TODO: explicit interface impl
             TestOutput(@"
 p Inst.GetEnumerator().nil?
-#p Inst.CompareTo(nil)
-#p Inst.Bar                               
-#p Inst.as(InterfaceFoo1).Foo   # or Inst.interface_method(InterfaceFoo1, :Foo).call ?
-#p Inst.as(InterfaceFoo2).Foo
-#p Inst.as(InterfaceBar1).Bar
+p Inst.baz
+p Inst.clr_member(System::IComparable, :compare_to).call(nil)
+p Inst.clr_member(InterfaceBar1, :bar).call
+p Inst.clr_member(InterfaceBar1, :bar).call(1)
+p Inst.clr_member(InterfaceFoo1, :foo).call
+p Inst.clr_member(InterfaceFoo2, :foo).call
+p Inst.clr_member(InterfaceFoo2, :[]).call(1)
+
+p Inst.clr_member(InterfaceFoo2, :evnt_value).call
+Inst.clr_member(InterfaceFoo2, :evnt).call { }
+p Inst.clr_member(InterfaceFoo2, :evnt_value).call
 ", @"
 false
+0
+1
+2
+3
+4
+5
+6
+0
+1
 ");
         }
 
===================================================================
edit: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Initializers.Generated.cs;C1200585
File: Initializers.Generated.cs
===================================================================
--- $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Initializers.Generated.cs;C1200585  (server)    10/9/2009 5:49 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Initializers.Generated.cs;ExplicitIfaces
@@ -2765,7 +2765,7 @@
             );
             
             module.DefineLibraryMethod("clr_member", 0x51, 
-                new Func<IronRuby.Runtime.RubyContext, System.Object, System.String, IronRuby.Builtins.RubyMethod>(IronRuby.Builtins.KernelOps.GetClrMember)
+                new Func<IronRuby.Runtime.RubyContext, System.Object, System.Object, System.String, IronRuby.Builtins.RubyMethod>(IronRuby.Builtins.KernelOps.GetClrMember)
             );
             
             module.DefineLibraryMethod("display", 0x51, 
===================================================================
edit: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/KernelOps.cs;C1200585
File: KernelOps.cs
===================================================================
--- $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/KernelOps.cs;C1200585  (server)    10/9/2009 4:19 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/KernelOps.cs;ExplicitIfaces
@@ -916,11 +916,13 @@
         /// Includes CLR private members if PrivateBinding is on.
         /// </summary>
         [RubyMethod("clr_member")]
-        public static RubyMethod/*!*/ GetClrMember(RubyContext/*!*/ context, object self, [DefaultProtocol, NotNull]string/*!*/ name) {
+        public static RubyMethod/*!*/ GetClrMember(RubyContext/*!*/ context, object self, [DefaultParameterValue(null), NotNull]object asType, 
+            [DefaultProtocol, NotNull]string/*!*/ name) {
             RubyMemberInfo info;
 
             RubyClass cls = context.GetClassOf(self);
-            if (!cls.TryGetClrMember(name, out info)) {
+            Type type = (asType != null) ? Protocols.ToType(context, asType) : null;
+            if (!cls.TryGetClrMember(name, type, out info)) {
                 throw RubyExceptions.CreateNameError(String.Format("undefined CLR method `{0}' for class `{1}'", name, cls.Name));
             }
 
===================================================================
edit: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyClass.cs;C1200585
File: RubyClass.cs
===================================================================
--- $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyClass.cs;C1200585  (server)    10/9/2009 3:51 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyClass.cs;ExplicitIfaces
@@ -682,6 +682,13 @@
 
         // thread safe: doesn't need any lock since it only accesses immutable state
         public bool TryGetClrMember(string/*!*/ name, out RubyMemberInfo method) {
+            return TryGetClrMember(name, null, out method);
+        }
+
+        // thread safe: doesn't need any lock since it only accesses immutable state
+        public bool TryGetClrMember(string/*!*/ name, Type asType, out RubyMemberInfo method) {
+            Debug.Assert(!_isSingletonClass);
+
             // Get the first class in hierarchy that represents CLR type - worse case we end up with Object.
             // Ruby classes don't represent a CLR type and hence expose no CLR members.
             RubyClass cls = this;
@@ -689,11 +696,18 @@
                 cls = cls.SuperClass;
             }
 
-            Debug.Assert(!cls.TypeTracker.Type.IsInterface);
+            Type type = cls.TypeTracker.Type;
+            Debug.Assert(!type.IsInterface);
 
-            // Note: We don't cache failures as this API is not used so frequently (e.g. for regular method dispatch) that we would need caching.
+            // Note: We don't cache results as this API is not used so frequently (e.g. for regular method dispatch).
+            
+            if (asType != null && !asType.IsAssignableFrom(type)) {
+                throw RubyExceptions.CreateNameError(String.Format("`{0}' does not inherit from `{0}'", cls.Name, Context.GetTypeName(asType, true)));
+            }
+
+            // TODO: should declaring module of the resulting method rather be the base class?
             method = null;
-            return cls.TryGetClrMember(cls.TypeTracker.Type, name, true, 0, out method);
+            return cls.TryGetClrMember(asType ?? type, name, true, 0, out method);
         }
 
         // thread safe: doesn't need any lock since it only accesses immutable state
@@ -725,6 +739,10 @@
             return false;
         }
 
+        /// <summary>
+        /// Returns a fresh instance of RubyMemberInfo each time it is called. The caller needs to cache it if appropriate.
+        /// May add or use method groups to/from super-clases if BindingFlags.DeclaredOnly is used.
+        /// </summary>
         private bool TryGetClrMember(Type/*!*/ type, string/*!*/ name, bool tryUnmangle, BindingFlags basicBindingFlags, out RubyMemberInfo method) {
             basicBindingFlags |= BindingFlags.Public | BindingFlags.NonPublic;
 
@@ -869,6 +887,12 @@
         ///        2) C.HidesInheritedOverloads == false
         ///           All overloads of the method we look for are in [type..C) and in the RubyMemberInfo.
         /// </summary>
+        /// <remarks>
+        /// Doesn't include explicitly implemented interface methods. Including them would allow to call them directly (obj.foo) 
+        /// if the overload resolution succeeds. However, the interface methods are probably implemented explicitly for a reason:
+        /// 1) There is a conflict in signatures -> the overload resolution would probably fail.
+        /// 2) The class was designed with an intention to not expose the implementations directly.
+        /// </remarks>
         private bool TryGetClrMethod(Type/*!*/ type, BindingFlags bindingFlags, bool specialNameOnly, 
             string/*!*/ name, string clrNamePrefix, string/*!*/ clrName, string altClrName, out RubyMemberInfo method) {
 
===================================================================
edit: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyMethod.cs;C1107696
File: RubyMethod.cs
===================================================================
--- $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyMethod.cs;C1107696  (server)    10/12/2009 11:28 AM
+++ Shelved Change: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyMethod.cs;ExplicitIfaces
@@ -25,11 +25,11 @@
 using IronRuby.Runtime;
 using IronRuby.Runtime.Calls;
 using Microsoft.Scripting.Utils;
+using Microsoft.Scripting.Generation;
 using AstUtils = Microsoft.Scripting.Ast.Utils;
 
 namespace IronRuby.Builtins {
     using Ast = Expression;
-
     using BlockCallTargetUnsplatN = Func<BlockParam, object, object[], RubyArray, object>;
 
     public partial class RubyMethod {
@@ -105,7 +105,7 @@
             metaBuilder.AddRestriction(Ast.Equal(args.TargetExpression, AstUtils.Constant(this)));
 
             // set the target (becomes self in the called method):
-            args.SetTarget(AstUtils.Constant(_target), _target);
+            args.SetTarget(AstUtils.Constant(_target, CompilerHelpers.GetVisibleType(_target)), _target);
 
             _info.BuildCall(metaBuilder, args, _name);
         }
===================================================================
edit: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Ruby/Runtime/Calls/RubyMemberInfo.cs;C966724
File: RubyMemberInfo.cs
===================================================================
--- $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Ruby/Runtime/Calls/RubyMemberInfo.cs;C966724  (server)    10/9/2009 6:17 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Ruby/Runtime/Calls/RubyMemberInfo.cs;ExplicitIfaces
@@ -145,6 +145,7 @@
         /// Method definition that replaces/overrides this method will cause version update of all dependent subclasses/modules, which
         /// triggers invalidation of sites that are bound to those classes.
         /// </summary>
+        [DebuggerDisplay("{_invalidateSitesOnOverride}")]
         internal bool InvalidateSitesOnOverride {
             get {
                 Context.RequiresClassHierarchyLock();
===================================================================
