Leading comments have trailing separator while trailing comments have leading space This removes the extra trailing space in the trailing comments
44 lines
1.1 KiB
JavaScript
44 lines
1.1 KiB
JavaScript
//// [genericCallWithFunctionTypedArguments4.ts]
|
|
// No inference is made from function typed arguments which have multiple call signatures
|
|
|
|
class C { foo: string }
|
|
class D { bar: string }
|
|
var a: {
|
|
new(x: boolean): C;
|
|
new(x: string): D;
|
|
}
|
|
|
|
function foo4<T, U>(cb: new(x: T) => U) {
|
|
var u: U;
|
|
return u;
|
|
}
|
|
|
|
var r = foo4(a); // T is {} (candidates boolean and string), U is {} (candidates C and D)
|
|
|
|
var b: {
|
|
new<T>(x: boolean): T;
|
|
new<T>(x: T): any;
|
|
}
|
|
|
|
var r2 = foo4(b); // T is {} (candidates boolean and {}), U is any (candidates any and {})
|
|
|
|
//// [genericCallWithFunctionTypedArguments4.js]
|
|
// No inference is made from function typed arguments which have multiple call signatures
|
|
var C = (function () {
|
|
function C() {
|
|
}
|
|
return C;
|
|
})();
|
|
var D = (function () {
|
|
function D() {
|
|
}
|
|
return D;
|
|
})();
|
|
var a;
|
|
function foo4(cb) {
|
|
var u;
|
|
return u;
|
|
}
|
|
var r = foo4(a); // T is {} (candidates boolean and string), U is {} (candidates C and D)
|
|
var b;
|
|
var r2 = foo4(b); // T is {} (candidates boolean and {}), U is any (candidates any and {})
|