Merge pull request #1185 from esdrubal/http-reuse
[mono.git] / mcs / mcs / field.cs
index 4b0b21685993678e3891b45c005db46cbadaf61d..3531af044f3bc39543000501a647a96f409e8b7a 100644 (file)
@@ -223,7 +223,9 @@ namespace Mono.CSharp
                        if (MemberType.IsStatic)
                                Error_VariableOfStaticClass (Location, GetSignatureForError (), MemberType, Report);
 
-                       CheckBase ();
+                       if (!IsCompilerGenerated)
+                               CheckBase ();
+
                        IsTypePermitted ();
                }
 
@@ -603,9 +605,23 @@ namespace Mono.CSharp
                        if (TypeSpec.IsReferenceType (MemberType))
                                return true;
 
-                       if (MemberType.IsEnum)
+                       if (MemberType.IsPointer)
                                return true;
 
+                       if (MemberType.IsEnum) {
+                               switch (EnumSpec.GetUnderlyingType (MemberType).BuiltinType) {
+                               case BuiltinTypeSpec.Type.SByte:
+                               case BuiltinTypeSpec.Type.Byte:
+                               case BuiltinTypeSpec.Type.Short:
+                               case BuiltinTypeSpec.Type.UShort:
+                               case BuiltinTypeSpec.Type.Int:
+                               case BuiltinTypeSpec.Type.UInt:
+                                       return true;
+                               default:
+                                       return false;
+                               }
+                       }
+
                        return false;
                }
 
@@ -707,7 +723,7 @@ namespace Mono.CSharp
                                loc = parameter.Location;
                        }
 
-                       public override TypeSpec ResolveAsType (IMemberContext mc)
+                       public override TypeSpec ResolveAsType (IMemberContext mc, bool allowUnboundTypeArguments)
                        {
                                return parameter.Type;
                        }