-
- public override TypeBuilder DefineType ()
- {
- if (TypeBuilder != null)
- return TypeBuilder;
-
- ec = new EmitContext (this, this, Location, null, null, ModFlags, false);
- ec.InEnumContext = true;
-
- if (!(BaseType is TypeLookupExpression)) {
- Report.Error (1008, Location,
- "Type byte, sbyte, short, ushort, int, uint, long or ulong expected");
- return null;
- }
-
- TypeExpr ute = ResolveBaseTypeExpr (BaseType, false, Location);
- UnderlyingType = ute.Type;
-
- if (UnderlyingType != TypeManager.int32_type &&
- UnderlyingType != TypeManager.uint32_type &&
- UnderlyingType != TypeManager.int64_type &&
- UnderlyingType != TypeManager.uint64_type &&
- UnderlyingType != TypeManager.short_type &&
- UnderlyingType != TypeManager.ushort_type &&
- UnderlyingType != TypeManager.byte_type &&
- UnderlyingType != TypeManager.sbyte_type) {
- Report.Error (1008, Location,
- "Type byte, sbyte, short, ushort, int, uint, long or ulong expected");
- return null;
- }