public void Emit(DeclSpace parent)
{
if (GenericMethod != null)
GenericMethod.EmitAttributes ();
var mc = (IMemberContext) method;
method.ParameterInfo.ApplyAttributes (mc, MethodBuilder);
SourceMethod source = SourceMethod.Create (parent, MethodBuilder, method.Block);
ToplevelBlock block = method.Block;
if (block != null) {
BlockContext bc = new BlockContext (mc, block, method.ReturnType);
if (block.Resolve (null, bc, method)) {
EmitContext ec = method.CreateEmitContext (MethodBuilder.GetILGenerator ());
if (!ec.HasReturnLabel && bc.HasReturnLabel) {
ec.ReturnLabel = bc.ReturnLabel;
ec.HasReturnLabel = true;
}
block.Emit (ec);
}
}
if (source != null) {
method.EmitExtraSymbolInfo (source);
source.CloseMethod ();
}
}