public TypeSpec InferReturnType (ResolveContext ec, TypeInferenceContext tic, TypeSpec delegate_type)
{
Expression expr;
AnonymousExpression am;
if (compatibles.TryGetValue (delegate_type, out expr)) {
am = expr as AnonymousExpression;
return am == null ? null : am.ReturnType;
}
using (ec.Set (ResolveContext.Options.ProbingMode | ResolveContext.Options.InferReturnType)) {
am = CompatibleMethodBody (ec, tic, InternalType.Arglist, delegate_type);
if (am != null)
am = am.Compatible (ec);
}
if (am == null)
return null;
// compatibles.Add (delegate_type, am);
return am.ReturnType;
}