1b5023bad3
Note the detachedComments and copyright headers comment emitting is not part of this change
17 lines
487 B
JavaScript
17 lines
487 B
JavaScript
//// [genericTypeWithCallableMembers2.ts]
|
|
function foo1<T extends { (): string; }>(f: T) {
|
|
return f(); // should return 'string', once returned 'any'
|
|
}
|
|
|
|
function foo2<T extends { new (): string; }>(f: T) {
|
|
return new f(); // should be legal, once was an error
|
|
}
|
|
|
|
//// [genericTypeWithCallableMembers2.js]
|
|
function foo1(f) {
|
|
return f(); // should return 'string', once returned 'any'
|
|
}
|
|
function foo2(f) {
|
|
return new f(); // should be legal, once was an error
|
|
}
|