2014-09-12 22:35:07 +02:00
|
|
|
tests/cases/compiler/interfaceDeclaration4.ts(39,14): error TS1005: '{' expected.
|
|
|
|
tests/cases/compiler/interfaceDeclaration4.ts(39,18): error TS1005: ';' expected.
|
2014-10-28 08:28:59 +01:00
|
|
|
tests/cases/compiler/interfaceDeclaration4.ts(18,11): error TS2430: Interface 'I3' incorrectly extends interface 'I1'.
|
|
|
|
Types of property 'item' are incompatible.
|
2014-09-12 22:35:07 +02:00
|
|
|
Type 'number' is not assignable to type 'string'.
|
2014-10-28 08:28:59 +01:00
|
|
|
tests/cases/compiler/interfaceDeclaration4.ts(27,7): error TS2420: Class 'C2' incorrectly implements interface 'I4'.
|
2014-09-12 22:35:07 +02:00
|
|
|
Property 'item' is missing in type 'C2'.
|
2014-10-28 08:28:59 +01:00
|
|
|
tests/cases/compiler/interfaceDeclaration4.ts(36,7): error TS2420: Class 'C3' incorrectly implements interface 'I1'.
|
2014-09-12 22:35:07 +02:00
|
|
|
Property 'item' is missing in type 'C3'.
|
|
|
|
tests/cases/compiler/interfaceDeclaration4.ts(39,15): error TS2304: Cannot find name 'I1'.
|
|
|
|
|
|
|
|
|
2014-07-13 01:04:16 +02:00
|
|
|
==== tests/cases/compiler/interfaceDeclaration4.ts (6 errors) ====
|
|
|
|
// Import this module when test harness supports external modules. Also remove the internal module below.
|
|
|
|
// import Foo = require("interfaceDeclaration5")
|
|
|
|
module Foo {
|
|
|
|
export interface I1 { item: string; }
|
|
|
|
export class C1 { }
|
|
|
|
}
|
|
|
|
|
|
|
|
class C1 implements Foo.I1 {
|
|
|
|
public item:string;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Allowed
|
|
|
|
interface I2 extends Foo.I1 {
|
|
|
|
item:string;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Negative Case
|
|
|
|
interface I3 extends Foo.I1 {
|
|
|
|
~~
|
2014-10-28 08:28:59 +01:00
|
|
|
!!! error TS2430: Interface 'I3' incorrectly extends interface 'I1'.
|
|
|
|
!!! error TS2430: Types of property 'item' are incompatible.
|
|
|
|
!!! error TS2430: Type 'number' is not assignable to type 'string'.
|
2014-07-13 01:04:16 +02:00
|
|
|
item:number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface I4 extends Foo.I1 {
|
|
|
|
token:string;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Err - not implemented item
|
|
|
|
class C2 implements I4 {
|
|
|
|
~~
|
2014-10-28 08:28:59 +01:00
|
|
|
!!! error TS2420: Class 'C2' incorrectly implements interface 'I4'.
|
|
|
|
!!! error TS2420: Property 'item' is missing in type 'C2'.
|
2014-07-13 01:04:16 +02:00
|
|
|
public token: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface I5 extends Foo { }
|
|
|
|
|
|
|
|
// Negative case
|
|
|
|
interface I6 extends Foo.C1 { }
|
|
|
|
|
|
|
|
class C3 implements Foo.I1 { }
|
|
|
|
~~
|
2014-10-28 08:28:59 +01:00
|
|
|
!!! error TS2420: Class 'C3' incorrectly implements interface 'I1'.
|
|
|
|
!!! error TS2420: Property 'item' is missing in type 'C3'.
|
2014-07-13 01:04:16 +02:00
|
|
|
|
|
|
|
// Negative case
|
|
|
|
interface Foo.I1 { }
|
|
|
|
~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS1005: '{' expected.
|
2014-07-13 01:04:16 +02:00
|
|
|
~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS1005: ';' expected.
|
2014-07-13 01:04:16 +02:00
|
|
|
~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2304: Cannot find name 'I1'.
|
2014-07-13 01:04:16 +02:00
|
|
|
|