2014-07-13 01:04:16 +02:00
|
|
|
//// [interfaceExtendsClassWithPrivate2.ts]
|
|
|
|
class C {
|
|
|
|
public foo(x: any) { return x; }
|
|
|
|
private x = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface I extends C {
|
|
|
|
other(x: any): any;
|
|
|
|
}
|
|
|
|
|
|
|
|
class D extends C implements I { // error
|
|
|
|
public foo(x: any) { return x; }
|
|
|
|
private x = 2;
|
|
|
|
private y = 3;
|
|
|
|
other(x: any) { return x; }
|
|
|
|
bar() {}
|
|
|
|
}
|
|
|
|
|
|
|
|
class D2 extends C implements I { // error
|
|
|
|
public foo(x: any) { return x; }
|
|
|
|
private x = "";
|
|
|
|
other(x: any) { return x; }
|
|
|
|
bar() { }
|
|
|
|
}
|
|
|
|
|
|
|
|
//// [interfaceExtendsClassWithPrivate2.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 __();
|
|
|
|
};
|
|
|
|
var C = (function () {
|
|
|
|
function C() {
|
|
|
|
this.x = 1;
|
|
|
|
}
|
2015-03-26 21:46:35 +01:00
|
|
|
C.prototype.foo = function (x) { return x; };
|
2014-07-13 01:04:16 +02:00
|
|
|
return C;
|
|
|
|
})();
|
|
|
|
var D = (function (_super) {
|
|
|
|
__extends(D, _super);
|
|
|
|
function D() {
|
|
|
|
_super.apply(this, arguments);
|
|
|
|
this.x = 2;
|
|
|
|
this.y = 3;
|
|
|
|
}
|
2015-03-26 21:46:35 +01:00
|
|
|
D.prototype.foo = function (x) { return x; };
|
|
|
|
D.prototype.other = function (x) { return x; };
|
|
|
|
D.prototype.bar = function () { };
|
2014-07-13 01:04:16 +02:00
|
|
|
return D;
|
|
|
|
})(C);
|
|
|
|
var D2 = (function (_super) {
|
|
|
|
__extends(D2, _super);
|
|
|
|
function D2() {
|
|
|
|
_super.apply(this, arguments);
|
|
|
|
this.x = "";
|
|
|
|
}
|
2015-03-26 21:46:35 +01:00
|
|
|
D2.prototype.foo = function (x) { return x; };
|
|
|
|
D2.prototype.other = function (x) { return x; };
|
|
|
|
D2.prototype.bar = function () { };
|
2014-07-13 01:04:16 +02:00
|
|
|
return D2;
|
|
|
|
})(C);
|