TypeScript/tests/baselines/reference/mergeThreeInterfaces2.types

177 lines
2.3 KiB
Plaintext
Raw Normal View History

2014-08-15 23:33:16 +02:00
=== tests/cases/conformance/interfaces/declarationMerging/mergeThreeInterfaces2.ts ===
// two interfaces with the same root module should merge
// root module now multiple module declarations
module M2 {
>M2 : typeof M2
2014-08-15 23:33:16 +02:00
export interface A {
>A : A
2014-08-15 23:33:16 +02:00
foo: string;
>foo : 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 r1 = a.foo;
>r1 : string
>a.foo : string
>a : A
>foo : string
2014-08-15 23:33:16 +02:00
var r2 = a.bar;
>r2 : number
>a.bar : number
>a : A
>bar : number
2014-08-15 23:33:16 +02:00
}
module M2 {
>M2 : typeof M2
2014-08-15 23:33:16 +02:00
export interface A {
>A : A
2014-08-15 23:33:16 +02:00
bar: number;
>bar : number
2014-08-15 23:33:16 +02:00
}
export interface A {
>A : A
2014-08-15 23:33:16 +02:00
baz: boolean;
>baz : boolean
2014-08-15 23:33:16 +02:00
}
var a: A;
>a : A
>A : A
2014-08-15 23:33:16 +02:00
var r1 = a.foo;
>r1 : string
>a.foo : string
>a : A
>foo : string
2014-08-15 23:33:16 +02:00
var r2 = a.bar;
>r2 : number
>a.bar : number
>a : A
>bar : number
2014-08-15 23:33:16 +02:00
var r3 = a.baz;
>r3 : boolean
>a.baz : boolean
>a : A
>baz : boolean
2014-08-15 23:33:16 +02:00
}
// same as above but with an additional level of nesting and third module declaration
module M2 {
>M2 : typeof M2
2014-08-15 23:33:16 +02:00
export module M3 {
>M3 : typeof M3
2014-08-15 23:33:16 +02:00
export interface A {
>A : A
2014-08-15 23:33:16 +02:00
foo: string;
>foo : 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 r1 = a.foo;
>r1 : string
>a.foo : string
>a : A
>foo : string
2014-08-15 23:33:16 +02:00
var r2 = a.bar;
>r2 : number
>a.bar : number
>a : A
>bar : number
2014-08-15 23:33:16 +02:00
}
}
module M2 {
>M2 : typeof M2
2014-08-15 23:33:16 +02:00
export module M3 {
>M3 : typeof M3
2014-08-15 23:33:16 +02:00
export interface A {
>A : A
2014-08-15 23:33:16 +02:00
bar: number;
>bar : number
2014-08-15 23:33:16 +02:00
}
var a: A;
>a : A
>A : A
2014-08-15 23:33:16 +02:00
var r1 = a.foo
>r1 : string
>a.foo : string
>a : A
>foo : string
2014-08-15 23:33:16 +02:00
var r2 = a.bar;
>r2 : number
>a.bar : number
>a : A
>bar : number
2014-08-15 23:33:16 +02:00
var r3 = a.baz;
>r3 : boolean
>a.baz : boolean
>a : A
>baz : boolean
2014-08-15 23:33:16 +02:00
}
}
module M2 {
>M2 : typeof M2
2014-08-15 23:33:16 +02:00
export module M3 {
>M3 : typeof M3
2014-08-15 23:33:16 +02:00
export interface A {
>A : A
2014-08-15 23:33:16 +02:00
baz: boolean;
>baz : boolean
2014-08-15 23:33:16 +02:00
}
var a: A;
>a : A
>A : A
2014-08-15 23:33:16 +02:00
var r1 = a.foo
>r1 : string
>a.foo : string
>a : A
>foo : string
2014-08-15 23:33:16 +02:00
var r2 = a.bar;
>r2 : number
>a.bar : number
>a : A
>bar : number
2014-08-15 23:33:16 +02:00
var r3 = a.baz;
>r3 : boolean
>a.baz : boolean
>a : A
>baz : boolean
2014-08-15 23:33:16 +02:00
}
}