TypeScript/tests/baselines/reference/typeArgumentInferenceWithClassExpression3.js
2015-12-08 17:51:10 -08:00

23 lines
503 B
TypeScript

//// [typeArgumentInferenceWithClassExpression3.ts]
function foo<T>(x = class { prop: T }): T {
return undefined;
}
foo(class { prop = "hello" }).length;
//// [typeArgumentInferenceWithClassExpression3.js]
function foo(x) {
if (x === void 0) { x = (function () {
function class_1() {
}
return class_1;
}()); }
return undefined;
}
foo((function () {
function class_2() {
this.prop = "hello";
}
return class_2;
}())).length;