2014-07-13 01:04:16 +02:00
|
|
|
//// [genericStaticAnyTypeFunction.ts]
|
|
|
|
class A {
|
|
|
|
|
|
|
|
static one<T>(source: T, value: number): T {
|
|
|
|
|
|
|
|
return source;
|
|
|
|
|
|
|
|
}
|
|
|
|
static goo() { return 0; }
|
|
|
|
|
|
|
|
static two<T>(source: T): T {
|
|
|
|
return this.one<T>(source, 42); // should not error
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//// [genericStaticAnyTypeFunction.js]
|
|
|
|
var A = (function () {
|
|
|
|
function A() {
|
|
|
|
}
|
|
|
|
A.one = function (source, value) {
|
|
|
|
return source;
|
|
|
|
};
|
2015-02-07 05:03:24 +01:00
|
|
|
A.goo = function () { return 0; };
|
2014-07-13 01:04:16 +02:00
|
|
|
A.two = function (source) {
|
2014-08-16 00:16:17 +02:00
|
|
|
return this.one(source, 42); // should not error
|
2014-07-13 01:04:16 +02:00
|
|
|
};
|
|
|
|
return A;
|
|
|
|
})();
|