TypeScript/tests/baselines/reference/mergedInterfacesWithMultipleBases2.types

172 lines
1.9 KiB
Plaintext
Raw Normal View History

2014-08-15 23:33:16 +02:00
=== tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithMultipleBases2.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
}
class C3 {
>C3 : C3
2014-08-15 23:33:16 +02:00
c: string;
>c : string
2014-08-15 23:33:16 +02:00
}
class C4 {
>C4 : C4
2014-08-15 23:33:16 +02:00
d: string;
>d : string
2014-08-15 23:33:16 +02:00
}
interface A extends C, C3 {
>A : A
>C : C
>C3 : C3
2014-08-15 23:33:16 +02:00
y: string;
>y : string
2014-08-15 23:33:16 +02:00
}
interface A extends C2, C4 {
>A : A
>C2 : C2
>C4 : C4
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
c: string;
>c : string
2014-08-15 23:33:16 +02:00
d: string;
>d : string
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
}
class C3<T> {
>C3 : C3<T>
>T : T
2014-08-15 23:33:16 +02:00
c: T;
>c : T
>T : T
2014-08-15 23:33:16 +02:00
}
class C4<T> {
>C4 : C4<T>
>T : T
2014-08-15 23:33:16 +02:00
d: T;
>d : T
>T : T
2014-08-15 23:33:16 +02:00
}
interface A<T> extends C<T>, C3<T> {
>A : A<T>
>T : T
>C : C<T>
>T : T
>C3 : C3<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>, C4<string> {
>A : A<T>
>T : T
>C2 : C2<T>
>C4 : C4<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
c: boolean;
>c : boolean
2014-08-15 23:33:16 +02:00
d: string;
>d : 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
}
}