edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/IronRuby.Tests/RubyTests.cs;C450622
File: RubyTests.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/IronRuby.Tests/RubyTests.cs;C450622  (server)    6/3/2008 10:48 AM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/IronRuby.Tests/RubyTests.cs;protected
@@ -225,6 +225,7 @@
                 ClrTypes1,
                 ClrGenerics1,
                 ClrMethods1,
+                ClrMethodsVisibility1,
                 ClrInterfaces1,
                 ClrRequireAssembly1,
                 ClrInclude1,
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/IronRuby.Tests/Runtime/ClrTests.cs;C450622
File: ClrTests.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/IronRuby.Tests/Runtime/ClrTests.cs;C450622  (server)    6/3/2008 10:47 AM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/IronRuby.Tests/Runtime/ClrTests.cs;protected
@@ -45,13 +45,19 @@
 
 namespace Ruby.Tests {
     public partial class Tests {
+#pragma warning disable 169 // private field not used
         public class ClassWithFields {
             public int Field = 1;
             public readonly int RoField = 2;
 
             public static int StaticField = 3;
             public const int ConstField = 4;
+
+            // TODO:
+            protected string ProtectedField;
+            private string PrivateField;
         }
+#pragma warning restore 169
 
         public void ClrFields1() {
             ExecutionContext.DefineGlobalVariable("obj", new ClassWithFields());
@@ -88,18 +94,18 @@
 ");
         }
 
-        public class ClassWithMethods {
+        public class ClassWithMethods1 {
             public int RoProperty { get { return 3; } }
             public int RwProperty { get { return 4; } set { } }
             public int WoProperty { set { } }
-
+            
             public int Method() { return 1; }
             public static int StaticMethod() { return 2; }
         }
 
         public void ClrMethods1() {
-            ExecutionContext.DefineGlobalVariable("obj", new ClassWithMethods());
-            ExecutionContext.DefineGlobalVariable("cls", typeof(ClassWithMethods));
+            ExecutionContext.DefineGlobalVariable("obj", new ClassWithMethods1());
+            ExecutionContext.DefineGlobalVariable("cls", typeof(ClassWithMethods1));
 
             AssertOutput(delegate() {
                 CompilerTest(@"
@@ -129,6 +135,97 @@
 ");
         }
 
+        public class ClassWithMethods2 {
+            public string Data;
+            
+            protected string ProtectedMethod() { return "ProtectedMethod"; }
+            private string PrivateMethod() { return "PrivateMethod"; }
+
+            protected string ProtectedProperty { 
+                get { return "ProtectedProperty"; } 
+                set { Data = value; } 
+            }
+
+            private string PrivateProperty { get { return "PrivateProperty"; } set { Data = value; } }
+
+            public string ProtectedGetter { protected get { return "ProtectedGetter"; } set { Data = value; } }
+            public string PrivateGetter { private get { return "PrivateGetter"; } set { Data = value; } }
+            public string ProtectedSetter { get { return "ProtectedSetter"; } protected set { Data = value; } }
+            public string PrivateSetter { get { return "PrivateSetter"; } private set { Data = value; } }
+
+            protected string ProtectedWithPrivateGetter { private get { return "ProtectedWithPrivateGetter"; } set { Data = value; } }
+            protected string ProtectedWithPrivateSetter { get { return "ProtectedWithPrivateSetter"; } private set { Data = value; } }
+        }
+
+        public void ClrMethodsVisibility1() {
+            ExecutionContext.ObjectClass.SetConstant("C", ExecutionContext.GetClass(typeof(ClassWithMethods2)));
+            AssertOutput(delegate() {
+                CompilerTest(@"
+class D < C
+  def test name
+    self.data = 'none'
+    sname = name.to_s    
+
+    begin
+      puts 'ok read: ' + send(sname) 
+    rescue 
+      puts 'error read: ' + sname 
+    end
+
+    begin
+      send(sname + '=', sname) 
+      print 'ok write: ' + sname + ' = '
+    rescue
+      puts 'error write: ' + sname
+    end
+
+    puts self.data
+  end
+ 
+  def foo
+    puts protected_method
+    private_method rescue puts 'error call: private_method'
+
+    test :protected_property
+    test :private_property
+
+    test :protected_getter
+    test :protected_setter
+    test :private_getter
+    test :private_setter
+
+    test :protected_with_private_getter    
+    test :protected_with_private_setter
+  end
+end
+
+D.new.foo
+");
+            }, @"
+ProtectedMethod
+error call: private_method
+ok read: ProtectedProperty
+ok write: protected_property = protected_property
+error read: private_property
+error write: private_property
+none
+ok read: ProtectedGetter
+ok write: protected_getter = protected_getter
+ok read: ProtectedSetter
+ok write: protected_setter = protected_setter
+error read: private_getter
+ok write: private_getter = private_getter
+ok read: PrivateSetter
+error write: private_setter
+none
+error read: protected_with_private_getter
+ok write: protected_with_private_getter = protected_with_private_getter
+ok read: ProtectedWithPrivateSetter
+error write: protected_with_private_setter
+none
+");
+        }
+
         public class ClassWithInterfaces1 : IEnumerable {
             public IEnumerator GetEnumerator() {
                 yield return 1;
@@ -168,8 +265,8 @@
         /// Type represents a class object - it is equivalent to RubyClass.
         /// </summary>
         public void ClrTypes1() {
-            TestTypeAndTracker(typeof(ClassWithMethods));
-            TestTypeAndTracker(ReflectionCache.GetTypeTracker(typeof(ClassWithMethods)));
+            TestTypeAndTracker(typeof(ClassWithMethods1));
+            TestTypeAndTracker(ReflectionCache.GetTypeTracker(typeof(ClassWithMethods1)));
         }
 
         public void TestTypeAndTracker(object type) {
@@ -190,7 +287,7 @@
 {1}
 2
 NoMethodError
-", RubyUtils.GetQualifiedName(type.GetType()), RubyUtils.GetQualifiedName(typeof(ClassWithMethods))), OutputFlags.Match);
+", RubyUtils.GetQualifiedName(type.GetType()), RubyUtils.GetQualifiedName(typeof(ClassWithMethods1))), OutputFlags.Match);
         }
         
         public void ClrGenerics1() {
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyClass.cs;C456173
File: RubyClass.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyClass.cs;C456173  (server)    6/3/2008 11:06 AM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyClass.cs;protected
@@ -210,7 +210,7 @@
         protected override bool TryGetClrMember(Type/*!*/ type, SymbolId name, out RubyMemberInfo method) {
             string strName, unmangled;
 
-            BindingFlags bindingFlags = BindingFlags.Public | BindingFlags.DeclaredOnly;
+            BindingFlags bindingFlags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.DeclaredOnly;
             bindingFlags |= (_isSingletonClass) ? BindingFlags.Static : BindingFlags.Instance;
 
             strName = SymbolTable.IdToString(name);
@@ -250,8 +250,13 @@
 
         private bool TryGetClrMethod(Type/*!*/ type, BindingFlags bindingFlags, string/*!*/ name, out RubyMemberInfo method) {
             Assert.NotNull(type, name);
-            
-            MethodGroup methodGroup = ReflectionCache.GetMethodGroup(type, name, bindingFlags | BindingFlags.InvokeMethod, null);
+
+            MethodGroup methodGroup = ReflectionCache.GetMethodGroup(type, name, bindingFlags | BindingFlags.InvokeMethod, 
+                delegate(MemberInfo m, object obj) {
+                    return m.Name == name && !((MethodInfo)m).IsPrivate;
+                }
+            );
+
             if (methodGroup != null) {
                 method = new RubyMethodGroupInfo(methodGroup, this, _isSingletonClass);
                 return true;
@@ -265,7 +270,7 @@
             Assert.NotNull(type, name);
 
             FieldInfo fieldInfo = type.GetField(name, bindingFlags);
-            if (fieldInfo != null && (!isWrite || !fieldInfo.IsInitOnly && !fieldInfo.IsLiteral)) {
+            if (fieldInfo != null && !fieldInfo.IsPrivate && (!isWrite || !fieldInfo.IsInitOnly && !fieldInfo.IsLiteral)) {
                 method = new RubyFieldInfo(fieldInfo, this, isWrite);
                 return true;
             }
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/Calls/RubyFieldInfo.cs;C443395
File: RubyFieldInfo.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/Calls/RubyFieldInfo.cs;C443395  (server)    6/3/2008 4:08 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/Calls/RubyFieldInfo.cs;protected
@@ -44,7 +44,7 @@
             if (_isSetter) {
                 // parameters should be: instance/type, value
                 if (args.Length == 2) {
-                    expr = Ast.AssignField(instance, _fieldInfo, Ast.Convert(args.Expressions[1], _fieldInfo.FieldType));
+                    expr = Ast.AssignField(instance, _fieldInfo, binder.ConvertExpression(args.Expressions[1], _fieldInfo.FieldType, rule.Context));
                 }
             } else {
                 // parameter should be: instance/type
===================================================================
