TypeScript/tests/baselines/reference/mergedInterfacesWithMultipleBases.types

122 lines
1.4 KiB
Plaintext
Raw Normal View History

2014-08-15 23:33:16 +02:00
=== tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithMultipleBases.ts ===
// merged interfaces behave as if all extends clauses from each declaration are merged together
// no errors expected
class C {
>C : C
2014-08-15 23:33:16 +02:00
a: number;
>a : number
2014-08-15 23:33:16 +02:00
}
class C2 {
>C2 : C2
2014-08-15 23:33:16 +02:00
b: number;
>b : number
2014-08-15 23:33:16 +02:00
}
interface A extends C {
>A : A
>C : C
2014-08-15 23:33:16 +02:00
y: string;
>y : string
2014-08-15 23:33:16 +02:00
}
interface A extends C2 {
>A : A
>C2 : C2
2014-08-15 23:33:16 +02:00
z: string;
>z : string
2014-08-15 23:33:16 +02:00
}
class D implements A {
>D : D
>A : A
2014-08-15 23:33:16 +02:00
a: number;
>a : number
2014-08-15 23:33:16 +02:00
b: number;
>b : number
2014-08-15 23:33:16 +02:00
y: string;
>y : string
2014-08-15 23:33:16 +02:00
z: string;
>z : string
2014-08-15 23:33:16 +02:00
}
var a: A;
>a : A
>A : A
2014-08-15 23:33:16 +02:00
var r = a.a;
>r : number
>a.a : number
>a : A
>a : number
2014-08-15 23:33:16 +02:00
// generic interfaces in a module
module M {
>M : typeof M
2014-08-15 23:33:16 +02:00
class C<T> {
>C : C<T>
>T : T
2014-08-15 23:33:16 +02:00
a: T;
>a : T
>T : T
2014-08-15 23:33:16 +02:00
}
class C2<T> {
>C2 : C2<T>
>T : T
2014-08-15 23:33:16 +02:00
b: T;
>b : T
>T : T
2014-08-15 23:33:16 +02:00
}
interface A<T> extends C<T> {
>A : A<T>
>T : T
>C : C<T>
>T : T
2014-08-15 23:33:16 +02:00
y: T;
>y : T
>T : T
2014-08-15 23:33:16 +02:00
}
interface A<T> extends C2<string> {
>A : A<T>
>T : T
>C2 : C2<T>
2014-08-15 23:33:16 +02:00
z: T;
>z : T
>T : T
2014-08-15 23:33:16 +02:00
}
class D implements A<boolean> {
>D : D
>A : A<T>
2014-08-15 23:33:16 +02:00
a: boolean;
>a : boolean
2014-08-15 23:33:16 +02:00
b: string;
>b : string
2014-08-15 23:33:16 +02:00
y: boolean;
>y : boolean
2014-08-15 23:33:16 +02:00
z: boolean;
>z : boolean
2014-08-15 23:33:16 +02:00
}
}