79 lines
No EOL
2.7 KiB
Text
79 lines
No EOL
2.7 KiB
Text
tests/cases/compiler/interfaceDeclaration3.ts(6,11): error TS2420: Class 'C1' incorrectly implements interface 'I1'.
|
|
Types of property 'item' are incompatible.
|
|
Type 'number' is not assignable to type 'string'.
|
|
tests/cases/compiler/interfaceDeclaration3.ts(31,11): error TS2420: Class 'C1' incorrectly implements interface 'I1'.
|
|
Types of property 'item' are incompatible.
|
|
Type 'number' is not assignable to type 'string'.
|
|
tests/cases/compiler/interfaceDeclaration3.ts(54,11): error TS2430: Interface 'I2' incorrectly extends interface 'I1'.
|
|
Types of property 'item' are incompatible.
|
|
Type 'string' is not assignable to type 'number'.
|
|
|
|
|
|
==== tests/cases/compiler/interfaceDeclaration3.ts (3 errors) ====
|
|
interface I1 { item:number; }
|
|
|
|
module M1 {
|
|
interface I1 { item:string; }
|
|
interface I2 { item:number; }
|
|
class C1 implements I1 {
|
|
~~
|
|
!!! error TS2420: Class 'C1' incorrectly implements interface 'I1'.
|
|
!!! error TS2420: Types of property 'item' are incompatible.
|
|
!!! error TS2420: Type 'number' is not assignable to type 'string'.
|
|
public item:number;
|
|
}
|
|
class C2 implements I1 {
|
|
public item:string;
|
|
}
|
|
class C3 implements I2 {
|
|
public item:number;
|
|
}
|
|
|
|
class C4 implements M2.I1 {
|
|
public item:string;
|
|
}
|
|
|
|
class C5 implements M2.M3.I1 {
|
|
public item:string;
|
|
}
|
|
}
|
|
|
|
export module M2 {
|
|
export interface I1 { item:string; }
|
|
export interface I2 { item:string; }
|
|
export module M3 {
|
|
export interface I1 { item:string; }
|
|
}
|
|
class C1 implements I1 {
|
|
~~
|
|
!!! error TS2420: Class 'C1' incorrectly implements interface 'I1'.
|
|
!!! error TS2420: Types of property 'item' are incompatible.
|
|
!!! error TS2420: Type 'number' is not assignable to type 'string'.
|
|
public item:number;
|
|
}
|
|
class C2 implements I1 {
|
|
public item:string;
|
|
}
|
|
class C3 implements I2 {
|
|
public item:string;
|
|
}
|
|
}
|
|
|
|
class C1 implements I1 {
|
|
public item:number;
|
|
}
|
|
|
|
class C2 implements M2.I1 {
|
|
public item:string;
|
|
}
|
|
|
|
class C3 implements M2.M3.I1 {
|
|
public item:string;
|
|
}
|
|
|
|
interface I2 extends I1 { item:string; }
|
|
~~
|
|
!!! error TS2430: Interface 'I2' incorrectly extends interface 'I1'.
|
|
!!! error TS2430: Types of property 'item' are incompatible.
|
|
!!! error TS2430: Type 'string' is not assignable to type 'number'.
|
|
|