2014-07-13 01:04:16 +02:00
|
|
|
//// [callOverloads5.ts]
|
2014-10-01 20:27:20 +02:00
|
|
|
function Foo():Foo; // error
|
|
|
|
function Foo(s:string):Foo; // error
|
|
|
|
class Foo { // error
|
2014-07-13 01:04:16 +02:00
|
|
|
bar1(s:string);
|
|
|
|
bar1(n:number);
|
|
|
|
bar1(a:any) { /*WScript.Echo(a);*/ }
|
|
|
|
constructor(x: any) {
|
|
|
|
// WScript.Echo("Constructor function has executed");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//class Foo(s: String);
|
|
|
|
|
|
|
|
var f1 = new Foo("hey");
|
|
|
|
|
|
|
|
|
|
|
|
f1.bar1("a");
|
|
|
|
Foo();
|
|
|
|
Foo("s");
|
|
|
|
|
|
|
|
|
|
|
|
//// [callOverloads5.js]
|
|
|
|
var Foo = (function () {
|
|
|
|
function Foo(x) {
|
2014-08-22 02:17:32 +02:00
|
|
|
// WScript.Echo("Constructor function has executed");
|
2014-07-13 01:04:16 +02:00
|
|
|
}
|
2015-02-07 03:45:09 +01:00
|
|
|
Foo.prototype.bar1 = function (a) { };
|
2014-07-13 01:04:16 +02:00
|
|
|
return Foo;
|
|
|
|
})();
|
2014-08-12 00:54:12 +02:00
|
|
|
//class Foo(s: String);
|
2014-07-13 01:04:16 +02:00
|
|
|
var f1 = new Foo("hey");
|
|
|
|
f1.bar1("a");
|
|
|
|
Foo();
|
|
|
|
Foo("s");
|