94 lines
No EOL
3.7 KiB
Text
94 lines
No EOL
3.7 KiB
Text
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersAccessibility2.ts(16,11): error TS2415: Class 'B' incorrectly extends base class 'A'.
|
|
Property 'foo' is private in type 'A' but not in type 'B'.
|
|
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersAccessibility2.ts(24,11): error TS2415: Class 'B2' incorrectly extends base class 'A2'.
|
|
Property '1' is private in type 'A2' but not in type 'B2'.
|
|
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersAccessibility2.ts(32,11): error TS2415: Class 'B3' incorrectly extends base class 'A3'.
|
|
Property ''1'' is private in type 'A3' but not in type 'B3'.
|
|
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersAccessibility2.ts(42,11): error TS2415: Class 'B' incorrectly extends base class 'A'.
|
|
Property 'foo' is private in type 'A' but not in type 'B'.
|
|
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersAccessibility2.ts(50,11): error TS2415: Class 'B2' incorrectly extends base class 'A2'.
|
|
Property '1' is private in type 'A2' but not in type 'B2'.
|
|
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersAccessibility2.ts(58,11): error TS2415: Class 'B3' incorrectly extends base class 'A3'.
|
|
Property ''1'' is private in type 'A3' but not in type 'B3'.
|
|
|
|
|
|
==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersAccessibility2.ts (6 errors) ====
|
|
// Derived member is private, base member is not causes errors
|
|
|
|
class Base {
|
|
foo: string;
|
|
}
|
|
|
|
class Derived extends Base {
|
|
bar: string;
|
|
}
|
|
|
|
module ExplicitPublic {
|
|
class A {
|
|
private foo: Base;
|
|
}
|
|
|
|
class B extends A {
|
|
~
|
|
!!! error TS2415: Class 'B' incorrectly extends base class 'A'.
|
|
!!! error TS2415: Property 'foo' is private in type 'A' but not in type 'B'.
|
|
public foo: Derived; // error
|
|
}
|
|
|
|
class A2 {
|
|
private 1: Base;
|
|
}
|
|
|
|
class B2 extends A2 {
|
|
~~
|
|
!!! error TS2415: Class 'B2' incorrectly extends base class 'A2'.
|
|
!!! error TS2415: Property '1' is private in type 'A2' but not in type 'B2'.
|
|
public 1: Derived; // error
|
|
}
|
|
|
|
class A3 {
|
|
private '1': Base;
|
|
}
|
|
|
|
class B3 extends A3 {
|
|
~~
|
|
!!! error TS2415: Class 'B3' incorrectly extends base class 'A3'.
|
|
!!! error TS2415: Property ''1'' is private in type 'A3' but not in type 'B3'.
|
|
public '1': Derived; // error
|
|
}
|
|
}
|
|
|
|
module ImplicitPublic {
|
|
class A {
|
|
private foo: Base;
|
|
}
|
|
|
|
class B extends A {
|
|
~
|
|
!!! error TS2415: Class 'B' incorrectly extends base class 'A'.
|
|
!!! error TS2415: Property 'foo' is private in type 'A' but not in type 'B'.
|
|
foo: Derived; // error
|
|
}
|
|
|
|
class A2 {
|
|
private 1: Base;
|
|
}
|
|
|
|
class B2 extends A2 {
|
|
~~
|
|
!!! error TS2415: Class 'B2' incorrectly extends base class 'A2'.
|
|
!!! error TS2415: Property '1' is private in type 'A2' but not in type 'B2'.
|
|
1: Derived; // error
|
|
}
|
|
|
|
class A3 {
|
|
private '1': Base;
|
|
}
|
|
|
|
class B3 extends A3 {
|
|
~~
|
|
!!! error TS2415: Class 'B3' incorrectly extends base class 'A3'.
|
|
!!! error TS2415: Property ''1'' is private in type 'A3' but not in type 'B3'.
|
|
'1': Derived; // error
|
|
}
|
|
} |