Output types
If E is a method group or an anonymous function and T is a delegate type or expression tree type then the return type of T is an output type of E with type T. Dependence An unfixed type variable Xi depends directly on an unfixed type variable Xj if for some argument Ek with type Tk Xj occurs in an input type of Ek with type Tk and Xi occurs in an output type of Ek with type Tk. Xj depends on Xi if Xj depends directly on Xi or if Xi depends directly on Xk and Xk depends on Xj. Thus “depends on” is the transitive but not reflexive closure of “depends directly on”. Output type inferences An output type inference is made from an expression E with type T in the following way: · If E is an anonymous function with inferred return type U (§7.4.2.11) and T is a delegate type or expression tree type with return type Tb, then a lower-bound inference (§7.4.2.9) is made from U for Tb. · Otherwise, if E is a method group and T is a delegate type or expression tree type return type Tb with parameter types T1…Tk and return type Tb, and overload resolution of E with the types T1…Tk yields a single method with return type U, then a lower-bound inference is made from U for Tb. · Otherwise, if e is an expression with type U, then a lower-bound inference is made from U for T. · Otherwise, no inferences are made.
|