6e77e2e810
Also got rid of the 'terminalMessages' concept.
124 lines
6.9 KiB
Plaintext
124 lines
6.9 KiB
Plaintext
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); }
|
|
} |