TypeScript/tests/cases/conformance
Sheetal Nandi 9d31631fd7 Test cases of function infering return type of functions
if f is a contextually typed function expression (section 4.9.3), the inferred return type is the union type (section 3.3.4) of the types of the return statement expressions in the function body, ignoring return statements with no expressions.
Otherwise, the inferred return type is the first of the types of the return statement expressions in the function body that is a supertype (section 3.8.3) of each of the others, ignoring return statements with no expressions. A compile-time error occurs if no return statement expression has a type that is a supertype of each of the others.
2014-11-04 16:40:56 -08:00
..
ambient Conformance coverage for spec change #589 2014-09-05 18:44:49 -07:00
classes Update baselines 2014-09-30 18:09:55 -07:00
declarationEmit Conformance coverage for spec change #589 2014-09-05 18:44:49 -07:00
enums Conformance coverage for spec change #589 2014-09-05 18:44:49 -07:00
es6/templates Omit empty template tail literals. 2014-10-28 18:47:43 -07:00
expressions Tests for Conditional operator can generate union type 2014-11-04 13:18:43 -08:00
externalModules Add snapshot of compiler sources 2014-07-12 17:30:19 -07:00
functions Test cases of function infering return type of functions 2014-11-04 16:40:56 -08:00
interfaces Added protected conformance tests 2014-09-23 11:22:38 -07:00
internalModules Add snapshot of compiler sources 2014-07-12 17:30:19 -07:00
parser Report duplicate identifier errors on all locations for merged declarations to align with local declarations 2014-10-14 15:18:44 -07:00
scanner Update baselines 2014-08-27 16:58:31 -07:00
statements Update baselines 2014-08-27 16:58:31 -07:00
types Array literal produces union type if the it is not contextually typed 2014-11-04 15:58:44 -08:00