31 lines
No EOL
710 B
Text
31 lines
No EOL
710 B
Text
==== tests/cases/compiler/interfaceImplementation6.ts (2 errors) ====
|
|
interface I1 {
|
|
item:number;
|
|
}
|
|
|
|
class C1 implements I1 {
|
|
public item:number;
|
|
}
|
|
|
|
class C2 implements I1 {
|
|
~~
|
|
!!! Class 'C2' incorrectly implements interface 'I1':
|
|
!!! Private property 'item' cannot be reimplemented.
|
|
private item:number;
|
|
}
|
|
|
|
class C3 implements I1 {
|
|
~~
|
|
!!! Class 'C3' incorrectly implements interface 'I1':
|
|
!!! Property 'item' is missing in type 'C3'.
|
|
constructor() {
|
|
var item: number;
|
|
}
|
|
}
|
|
|
|
export class Test {
|
|
private pt: I1 = { item: 1 };
|
|
}
|
|
|
|
|
|
|