2003-01-23 Miguel de Icaza <miguel@ximian.com>
authorMiguel de Icaza <miguel@gnome.org>
Tue, 8 Apr 2003 22:54:46 +0000 (22:54 -0000)
committerMiguel de Icaza <miguel@gnome.org>
Tue, 8 Apr 2003 22:54:46 +0000 (22:54 -0000)
* class.cs (MethodData.Define): It is wrong for an interface
implementation to be static in both cases: explicit and implicit.
We were only handling this in one case.

Improve the if situation there to not have negations.

* class.cs (Field.Define): Turns out that we do not need to check
the unsafe bit on field definition, only on usage.  Remove the test.

svn path=/trunk/mcs/; revision=13357

mcs/mcs/ChangeLog
mcs/mcs/class.cs

index d0b0de65c9fa39b0b8ecef66112509ce0177cb25..c1cfa74608af1e7e578f65f670e893b827b6cd8f 100755 (executable)
@@ -1,3 +1,14 @@
+2003-01-23  Miguel de Icaza  <miguel@ximian.com>
+
+       * class.cs (MethodData.Define): It is wrong for an interface
+       implementation to be static in both cases: explicit and implicit.
+       We were only handling this in one case.
+
+       Improve the if situation there to not have negations.
+       
+       * class.cs (Field.Define): Turns out that we do not need to check
+       the unsafe bit on field definition, only on usage.  Remove the test.
+
 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
 
        * driver.cs: use assembly.Location instead of Codebase (the latest
index d749eb8a2aa3c771202e8e0630e1d2726054e02a..d10c4eb206ef239f6af093f26026843b78374252 100755 (executable)
@@ -2993,24 +2993,26 @@ namespace Mono.CSharp {
                                // The "candidate" function has been flagged already
                                // but it wont get cleared
                                //
-                               if (!member.IsExplicitImpl){
+                               if (member.IsExplicitImpl){
+                                       if ((modifiers & (Modifiers.PUBLIC | Modifiers.ABSTRACT | Modifiers.VIRTUAL)) != 0){
+                                               Modifiers.Error_InvalidModifier (Location, "public, virtual or abstract");
+                                               implementing = null;
+                                       }
+                               } else {
                                        //
                                        // We already catch different accessibility settings
                                        // so we just need to check that we are not private
                                        //
                                        if ((modifiers & Modifiers.PRIVATE) != 0)
                                                implementing = null;
+                               } 
                                        
-                                       //
-                                       // Static is not allowed
-                                       //
-                                       if ((modifiers & Modifiers.STATIC) != 0)
-                                               implementing = null;
-                               } else {
-                                       if ((modifiers & (Modifiers.PUBLIC | Modifiers.ABSTRACT | Modifiers.VIRTUAL)) != 0){
-                                               Modifiers.Error_InvalidModifier (Location, "public, virtual or abstract");
-                                               implementing = null;
-                                       }
+                               //
+                               // Static is not allowed
+                               //
+                               if ((modifiers & Modifiers.STATIC) != 0){
+                                       implementing = null;
+                                       Modifiers.Error_InvalidModifier (Location, "static");
                                }
                        }
                        
@@ -3482,9 +3484,6 @@ namespace Mono.CSharp {
                                return false;
                        }
 
-                       if (t.IsPointer && !UnsafeOK (parent))
-                               return false;
-                               
                        if (RootContext.WarningLevel > 1){
                                Type ptype = parent.TypeBuilder.BaseType;