7748694d60
* Relate non-augmenting array subtypes without resorting to structural comparison
* Fix lint
* Generalize performance enhancement
* Cache results, feed through via getNormalizedType to remove error intermediates
* Use newly freed up object flags to limit member setting, fix crash with those object flags
* Move flags because there is no TypeFlags.Reference 🤦
58 lines
1.8 KiB
Plaintext
58 lines
1.8 KiB
Plaintext
tests/cases/compiler/interfaceImplementation8.ts(12,7): error TS2420: Class 'C2' incorrectly implements interface 'i1'.
|
|
Property 'name' is private in type 'C2' but not in type 'i1'.
|
|
tests/cases/compiler/interfaceImplementation8.ts(21,7): error TS2420: Class 'C5' incorrectly implements interface 'i1'.
|
|
Property 'name' is private in type 'C2' but not in type 'i1'.
|
|
tests/cases/compiler/interfaceImplementation8.ts(22,7): error TS2420: Class 'C6' incorrectly implements interface 'i1'.
|
|
Property 'name' is private in type 'C3' but not in type 'i1'.
|
|
|
|
|
|
==== tests/cases/compiler/interfaceImplementation8.ts (3 errors) ====
|
|
/*
|
|
1
|
|
*/
|
|
interface i1 {
|
|
name: string;
|
|
}
|
|
|
|
class C1 implements i1 {
|
|
public name:string;
|
|
}
|
|
|
|
class C2 implements i1 {
|
|
~~
|
|
!!! error TS2420: Class 'C2' incorrectly implements interface 'i1'.
|
|
!!! error TS2420: Property 'name' is private in type 'C2' but not in type 'i1'.
|
|
private name:string;
|
|
}
|
|
|
|
class C3 {
|
|
private name:any;
|
|
}
|
|
|
|
class C4 extends C1 implements i1{ }
|
|
class C5 extends C2 implements i1{ }
|
|
~~
|
|
!!! error TS2420: Class 'C5' incorrectly implements interface 'i1'.
|
|
!!! error TS2420: Property 'name' is private in type 'C2' but not in type 'i1'.
|
|
class C6 extends C3 implements i1{ }
|
|
~~
|
|
!!! error TS2420: Class 'C6' incorrectly implements interface 'i1'.
|
|
!!! error TS2420: Property 'name' is private in type 'C3' but not in type 'i1'.
|
|
|
|
/*
|
|
2
|
|
*/
|
|
|
|
interface i2 {
|
|
name: string;
|
|
age: number;
|
|
}
|
|
|
|
class C7 {
|
|
public name:string;
|
|
}
|
|
|
|
class C8 extends C7 implements i2{
|
|
public age:number;
|
|
}
|
|
|