if (MemberType.IsStatic)
Error_VariableOfStaticClass (Location, GetSignatureForError (), MemberType, Report);
- CheckBase ();
+ if (!IsCompilerGenerated)
+ CheckBase ();
+
IsTypePermitted ();
}
}
// Create nested fixed buffer container
- string name = String.Format ("<{0}>__FixedBuffer{1}", Name, GlobalCounter++);
+ string name = String.Format ("<{0}>__FixedBuffer{1}", TypeDefinition.FilterNestedName (Name), GlobalCounter++);
fixed_buffer_type = Parent.TypeBuilder.DefineNestedType (name,
TypeAttributes.NestedPublic | TypeAttributes.Sealed | TypeAttributes.BeforeFieldInit,
Compiler.BuiltinTypes.ValueType.GetMetaInfo ());
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;
}
loc = parameter.Location;
}
- public override TypeSpec ResolveAsType (IMemberContext mc)
+ public override TypeSpec ResolveAsType (IMemberContext mc, bool allowUnboundTypeArguments)
{
return parameter.Type;
}