TypeScript/tests/baselines/reference/callOverloads4.js

33 lines
608 B
TypeScript
Raw Normal View History

2014-07-13 01:04:16 +02:00
//// [callOverloads4.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() { /*WScript.Echo("bar1");*/ }
constructor(s: string);
constructor(x: any) {
// WScript.Echo("Constructor function has executed");
}
}
var f1 = new Foo("hey");
f1.bar1();
Foo();
Foo("s");
//// [callOverloads4.js]
var Foo = (function () {
function Foo(x) {
// WScript.Echo("Constructor function has executed");
2014-07-13 01:04:16 +02:00
}
Foo.prototype.bar1 = function () { };
2014-07-13 01:04:16 +02:00
return Foo;
})();
var f1 = new Foo("hey");
f1.bar1();
Foo();
Foo("s");