2014-07-13 01:04:16 +02:00
|
|
|
//// [staticInheritance.ts]
|
|
|
|
function doThing(x: { n: string }) { }
|
|
|
|
class A {
|
|
|
|
static n: string;
|
|
|
|
p = doThing(A); // OK
|
|
|
|
}
|
|
|
|
class B extends A {
|
|
|
|
p1 = doThing(A); // OK
|
|
|
|
p2 = doThing(B); // OK
|
|
|
|
}
|
|
|
|
doThing(B); //OK
|
|
|
|
|
|
|
|
|
|
|
|
//// [staticInheritance.js]
|
|
|
|
var __extends = this.__extends || function (d, b) {
|
|
|
|
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
|
|
|
|
function __() { this.constructor = d; }
|
|
|
|
__.prototype = b.prototype;
|
|
|
|
d.prototype = new __();
|
|
|
|
};
|
2015-02-07 03:45:09 +01:00
|
|
|
function doThing(x) { }
|
2014-07-13 01:04:16 +02:00
|
|
|
var A = (function () {
|
|
|
|
function A() {
|
2014-08-15 22:18:54 +02:00
|
|
|
this.p = doThing(A); // OK
|
2014-07-13 01:04:16 +02:00
|
|
|
}
|
|
|
|
return A;
|
|
|
|
})();
|
|
|
|
var B = (function (_super) {
|
|
|
|
__extends(B, _super);
|
|
|
|
function B() {
|
|
|
|
_super.apply(this, arguments);
|
2014-08-15 22:18:54 +02:00
|
|
|
this.p1 = doThing(A); // OK
|
|
|
|
this.p2 = doThing(B); // OK
|
2014-07-13 01:04:16 +02:00
|
|
|
}
|
|
|
|
return B;
|
|
|
|
})(A);
|
2014-08-16 00:49:09 +02:00
|
|
|
doThing(B); //OK
|