2014-07-13 01:04:16 +02:00
|
|
|
//// [overloadsWithinClasses.ts]
|
|
|
|
class foo {
|
|
|
|
|
|
|
|
static fnOverload( ) {}
|
|
|
|
|
|
|
|
static fnOverload(foo: string){ } // error
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
class bar {
|
|
|
|
|
|
|
|
static fnOverload( );
|
|
|
|
|
|
|
|
static fnOverload(foo?: string){ } // no error
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
class X {
|
|
|
|
public attr(name:string):string;
|
|
|
|
public attr(name:string, value:string):X;
|
|
|
|
public attr(first:any, second?:any):any {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//// [overloadsWithinClasses.js]
|
|
|
|
var foo = (function () {
|
|
|
|
function foo() {
|
|
|
|
}
|
|
|
|
foo.fnOverload = function () {
|
|
|
|
};
|
|
|
|
foo.fnOverload = function (foo) {
|
2014-08-15 22:18:54 +02:00
|
|
|
}; // error
|
2014-07-13 01:04:16 +02:00
|
|
|
return foo;
|
|
|
|
})();
|
|
|
|
var bar = (function () {
|
|
|
|
function bar() {
|
|
|
|
}
|
|
|
|
bar.fnOverload = function (foo) {
|
2014-08-15 22:18:54 +02:00
|
|
|
}; // no error
|
2014-07-13 01:04:16 +02:00
|
|
|
return bar;
|
|
|
|
})();
|
|
|
|
var X = (function () {
|
|
|
|
function X() {
|
|
|
|
}
|
|
|
|
X.prototype.attr = function (first, second) {
|
|
|
|
};
|
|
|
|
return X;
|
|
|
|
})();
|