Mono.CSharp.AnonymousMethodExpression.InferReturnType C# (CSharp) Method

InferReturnType() public method

public InferReturnType ( ResolveContext ec, Mono.CSharp.TypeInferenceContext tic, System.TypeSpec delegate_type ) : System.TypeSpec
ec ResolveContext
tic Mono.CSharp.TypeInferenceContext
delegate_type System.TypeSpec
return System.TypeSpec
		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;
		}