2014-07-13 01:04:16 +02:00
|
|
|
//// [overloadCallTest.ts]
|
|
|
|
class foo {
|
|
|
|
constructor() {
|
|
|
|
function bar(): string;
|
|
|
|
function bar(s:string);
|
|
|
|
function bar(foo?: string) { return "foo" };
|
|
|
|
|
|
|
|
var test = bar("test");
|
|
|
|
var goo = bar();
|
|
|
|
|
|
|
|
goo = bar("test");
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//// [overloadCallTest.js]
|
|
|
|
var foo = (function () {
|
|
|
|
function foo() {
|
2015-02-07 05:03:24 +01:00
|
|
|
function bar(foo) { return "foo"; }
|
2014-07-13 01:04:16 +02:00
|
|
|
;
|
|
|
|
var test = bar("test");
|
|
|
|
var goo = bar();
|
|
|
|
goo = bar("test");
|
|
|
|
}
|
|
|
|
return foo;
|
|
|
|
})();
|