public override void Emit ()
{
if (OptAttributes != null)
OptAttributes.Emit ();
if (!IsCompilerGenerated) {
if (!IsTopLevel) {
MemberSpec candidate;
bool overrides = false;
var conflict_symbol = MemberCache.FindBaseMember (this, out candidate, ref overrides);
if (conflict_symbol == null && candidate == null) {
if ((ModFlags & Modifiers.NEW) != 0)
Report.Warning (109, 4, Location, "The member `{0}' does not hide an inherited member. The new keyword is not required",
GetSignatureForError ());
} else {
if ((ModFlags & Modifiers.NEW) == 0) {
if (candidate == null)
candidate = conflict_symbol;
Report.SymbolRelatedToPreviousError (candidate);
Report.Warning (108, 2, Location, "`{0}' hides inherited member `{1}'. Use the new keyword if hiding was intended",
GetSignatureForError (), candidate.GetSignatureForError ());
}
}
}
// Run constraints check on all possible generic types
if (base_type != null && base_type_expr != null) {
ConstraintChecker.Check (this, base_type, base_type_expr.Location);
}
if (iface_exprs != null) {
foreach (var iface_type in iface_exprs) {
if (iface_type == null)
continue;
ConstraintChecker.Check (this, iface_type, Location); // TODO: Location is wrong
}
}
}
if (all_tp_builders != null) {
int current_starts_index = CurrentTypeParametersStartIndex;
for (int i = 0; i < all_tp_builders.Length; i++) {
if (i < current_starts_index) {
all_type_parameters[i].EmitConstraints (all_tp_builders [i]);
} else {
var tp = CurrentTypeParameters [i - current_starts_index];
tp.CheckGenericConstraints (!IsObsolete);
tp.Emit ();
}
}
}
if ((ModFlags & Modifiers.COMPILER_GENERATED) != 0 && !Parent.IsCompilerGenerated)
Module.PredefinedAttributes.CompilerGenerated.EmitAttribute (TypeBuilder);
#if STATIC
if ((TypeBuilder.Attributes & TypeAttributes.StringFormatMask) == 0 && Module.HasDefaultCharSet)
TypeBuilder.__SetAttributes (TypeBuilder.Attributes | Module.DefaultCharSetType);
#endif
base.Emit ();
for (int i = 0; i < members.Count; i++) {
var m = members[i];
if ((m.caching_flags & Flags.CloseTypeCreated) != 0)
continue;
m.Emit ();
}
EmitIndexerName ();
CheckAttributeClsCompliance ();
if (pending != null)
pending.VerifyPendingMethods ();
}