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 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124
|
tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(23,7): error TS2415: Class 'Derived1' incorrectly extends base class 'Base'.
Property 'a' is protected in type 'Derived1' but public in type 'Base'.
tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(28,7): error TS2415: Class 'Derived2' incorrectly extends base class 'Base'.
Property 'b' is protected in type 'Derived2' but public in type 'Base'.
tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(33,7): error TS2415: Class 'Derived3' incorrectly extends base class 'Base'.
Property 'c' is protected in type 'Derived3' but public in type 'Base'.
tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(38,7): error TS2415: Class 'Derived4' incorrectly extends base class 'Base'.
Property 'c' is protected in type 'Derived4' but public in type 'Base'.
tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(43,7): error TS2415: Class 'Derived5' incorrectly extends base class 'Base'.
Property 'd' is protected in type 'Derived5' but public in type 'Base'.
tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(48,7): error TS2417: Class static side 'typeof Derived6' incorrectly extends base class static side 'typeof Base'.
Property 'r' is protected in type 'typeof Derived6' but public in type 'typeof Base'.
tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(53,7): error TS2417: Class static side 'typeof Derived7' incorrectly extends base class static side 'typeof Base'.
Property 's' is protected in type 'typeof Derived7' but public in type 'typeof Base'.
tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(58,7): error TS2417: Class static side 'typeof Derived8' incorrectly extends base class static side 'typeof Base'.
Property 't' is protected in type 'typeof Derived8' but public in type 'typeof Base'.
tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(63,7): error TS2417: Class static side 'typeof Derived9' incorrectly extends base class static side 'typeof Base'.
Property 't' is protected in type 'typeof Derived9' but public in type 'typeof Base'.
tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(68,7): error TS2417: Class static side 'typeof Derived10' incorrectly extends base class static side 'typeof Base'.
Property 'u' is protected in type 'typeof Derived10' but public in type 'typeof Base'.
==== tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts (10 errors) ====
var x: { foo: string; }
var y: { foo: string; bar: string; }
class Base {
a: typeof x;
b(a: typeof x) { }
get c() { return x; }
set c(v: typeof x) { }
d: (a: typeof x) => void;
static r: typeof x;
static s(a: typeof x) { }
static get t() { return x; }
static set t(v: typeof x) { }
static u: (a: typeof x) => void;
constructor(a: typeof x) {}
}
// Errors
// decrease visibility of all public members to protected
class Derived1 extends Base {
~~~~~~~~
!!! error TS2415: Class 'Derived1' incorrectly extends base class 'Base'.
!!! error TS2415: Property 'a' is protected in type 'Derived1' but public in type 'Base'.
protected a: typeof x;
constructor(a: typeof x) { super(a); }
}
class Derived2 extends Base {
~~~~~~~~
!!! error TS2415: Class 'Derived2' incorrectly extends base class 'Base'.
!!! error TS2415: Property 'b' is protected in type 'Derived2' but public in type 'Base'.
protected b(a: typeof x) { }
constructor(a: typeof x) { super(a); }
}
class Derived3 extends Base {
~~~~~~~~
!!! error TS2415: Class 'Derived3' incorrectly extends base class 'Base'.
!!! error TS2415: Property 'c' is protected in type 'Derived3' but public in type 'Base'.
protected get c() { return x; }
constructor(a: typeof x) { super(a); }
}
class Derived4 extends Base {
~~~~~~~~
!!! error TS2415: Class 'Derived4' incorrectly extends base class 'Base'.
!!! error TS2415: Property 'c' is protected in type 'Derived4' but public in type 'Base'.
protected set c(v: typeof x) { }
constructor(a: typeof x) { super(a); }
}
class Derived5 extends Base {
~~~~~~~~
!!! error TS2415: Class 'Derived5' incorrectly extends base class 'Base'.
!!! error TS2415: Property 'd' is protected in type 'Derived5' but public in type 'Base'.
protected d: (a: typeof x) => void ;
constructor(a: typeof x) { super(a); }
}
class Derived6 extends Base {
~~~~~~~~
!!! error TS2417: Class static side 'typeof Derived6' incorrectly extends base class static side 'typeof Base'.
!!! error TS2417: Property 'r' is protected in type 'typeof Derived6' but public in type 'typeof Base'.
protected static r: typeof x;
constructor(a: typeof x) { super(a); }
}
class Derived7 extends Base {
~~~~~~~~
!!! error TS2417: Class static side 'typeof Derived7' incorrectly extends base class static side 'typeof Base'.
!!! error TS2417: Property 's' is protected in type 'typeof Derived7' but public in type 'typeof Base'.
protected static s(a: typeof x) { }
constructor(a: typeof x) { super(a); }
}
class Derived8 extends Base {
~~~~~~~~
!!! error TS2417: Class static side 'typeof Derived8' incorrectly extends base class static side 'typeof Base'.
!!! error TS2417: Property 't' is protected in type 'typeof Derived8' but public in type 'typeof Base'.
protected static get t() { return x; }
constructor(a: typeof x) { super(a); }
}
class Derived9 extends Base {
~~~~~~~~
!!! error TS2417: Class static side 'typeof Derived9' incorrectly extends base class static side 'typeof Base'.
!!! error TS2417: Property 't' is protected in type 'typeof Derived9' but public in type 'typeof Base'.
protected static set t(v: typeof x) { }
constructor(a: typeof x) { super(a); }
}
class Derived10 extends Base {
~~~~~~~~~
!!! error TS2417: Class static side 'typeof Derived10' incorrectly extends base class static side 'typeof Base'.
!!! error TS2417: Property 'u' is protected in type 'typeof Derived10' but public in type 'typeof Base'.
protected static u: (a: typeof x) => void ;
constructor(a: typeof x) { super(a); }
}
|