1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
|
tests/cases/compiler/another.ts(11,1): error TS4094: Property '_assertIsStripped' of exported class expression may not be private or protected.
tests/cases/compiler/another.ts(11,1): error TS4094: Property '_onDispose' of exported class expression may not be private or protected.
tests/cases/compiler/first.ts(12,1): error TS4094: Property '_assertIsStripped' of exported class expression may not be private or protected.
tests/cases/compiler/first.ts(12,1): error TS4094: Property '_onDispose' of exported class expression may not be private or protected.
tests/cases/compiler/first.ts(13,14): error TS4094: Property '_assertIsStripped' of exported class expression may not be private or protected.
tests/cases/compiler/first.ts(13,14): error TS4094: Property '_onDispose' of exported class expression may not be private or protected.
==== tests/cases/compiler/first.ts (4 errors) ====
declare function mix<TMix>(mixin: TMix): TMix;
const DisposableMixin = class {
protected _onDispose() {
this._assertIsStripped()
}
private _assertIsStripped() {
}
};
// No error, but definition is wrong.
export default mix(DisposableMixin);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS4094: Property '_assertIsStripped' of exported class expression may not be private or protected.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS4094: Property '_onDispose' of exported class expression may not be private or protected.
export class Monitor extends mix(DisposableMixin) {
~~~~~~~
!!! error TS4094: Property '_assertIsStripped' of exported class expression may not be private or protected.
~~~~~~~
!!! error TS4094: Property '_onDispose' of exported class expression may not be private or protected.
protected _onDispose() {
}
}
==== tests/cases/compiler/another.ts (2 errors) ====
declare function mix<TMix>(mixin: TMix): TMix;
const DisposableMixin = class {
protected _onDispose() {
this._assertIsStripped()
}
private _assertIsStripped() {
}
};
export default class extends mix(DisposableMixin) {
~~~~~~
!!! error TS4094: Property '_assertIsStripped' of exported class expression may not be private or protected.
~~~~~~
!!! error TS4094: Property '_onDispose' of exported class expression may not be private or protected.
protected _onDispose() {
}
}
|