2015-02-03 00:30:33 +01:00
|
|
|
//// [privateInstanceMemberAccessibility.ts]
|
|
|
|
class Base {
|
|
|
|
private foo: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
class Derived extends Base {
|
|
|
|
x = super.foo; // error
|
|
|
|
y() {
|
|
|
|
return super.foo; // error
|
|
|
|
}
|
|
|
|
z: typeof super.foo; // error
|
|
|
|
|
|
|
|
a: this.foo; // error
|
|
|
|
}
|
|
|
|
|
|
|
|
//// [privateInstanceMemberAccessibility.js]
|
2015-05-01 19:49:54 +02:00
|
|
|
var __extends = (this && this.__extends) || function (d, b) {
|
2015-02-03 00:30:33 +01:00
|
|
|
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
|
|
|
|
function __() { this.constructor = d; }
|
|
|
|
__.prototype = b.prototype;
|
|
|
|
d.prototype = new __();
|
|
|
|
};
|
|
|
|
var Base = (function () {
|
|
|
|
function Base() {
|
|
|
|
}
|
|
|
|
return Base;
|
|
|
|
})();
|
|
|
|
var Derived = (function (_super) {
|
|
|
|
__extends(Derived, _super);
|
|
|
|
function Derived() {
|
|
|
|
_super.apply(this, arguments);
|
|
|
|
this.x = _super.prototype.foo; // error
|
|
|
|
this.z = _super.prototype.foo; // error
|
|
|
|
this.a = this.foo; // error
|
|
|
|
}
|
|
|
|
Derived.prototype.y = function () {
|
|
|
|
return _super.prototype.foo; // error
|
|
|
|
};
|
|
|
|
return Derived;
|
|
|
|
})(Base);
|