51 lines
No EOL
1.8 KiB
Text
51 lines
No EOL
1.8 KiB
Text
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersAccessibility.ts(15,7): error TS2416: Class 'B' incorrectly extends base class 'A':
|
|
Private property 'foo' cannot be reimplemented.
|
|
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersAccessibility.ts(23,7): error TS2416: Class 'B2' incorrectly extends base class 'A2':
|
|
Private property '1' cannot be reimplemented.
|
|
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersAccessibility.ts(31,7): error TS2416: Class 'B3' incorrectly extends base class 'A3':
|
|
Private property ''1'' cannot be reimplemented.
|
|
|
|
|
|
==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersAccessibility.ts (3 errors) ====
|
|
// Derived member is private, base member is not causes errors
|
|
|
|
class Base {
|
|
foo: string;
|
|
}
|
|
|
|
class Derived extends Base {
|
|
bar: string;
|
|
}
|
|
|
|
class A {
|
|
public foo: Base;
|
|
}
|
|
|
|
class B extends A {
|
|
~
|
|
!!! error TS2416: Class 'B' incorrectly extends base class 'A':
|
|
!!! error TS2416: Private property 'foo' cannot be reimplemented.
|
|
private foo: Derived; // error
|
|
}
|
|
|
|
class A2 {
|
|
public 1: Base;
|
|
}
|
|
|
|
class B2 extends A2 {
|
|
~~
|
|
!!! error TS2416: Class 'B2' incorrectly extends base class 'A2':
|
|
!!! error TS2416: Private property '1' cannot be reimplemented.
|
|
private 1: Derived; // error
|
|
}
|
|
|
|
class A3 {
|
|
public '1': Base;
|
|
}
|
|
|
|
class B3 extends A3 {
|
|
~~
|
|
!!! error TS2416: Class 'B3' incorrectly extends base class 'A3':
|
|
!!! error TS2416: Private property ''1'' cannot be reimplemented.
|
|
private '1': Derived; // error
|
|
} |