197 lines
8.5 KiB
Text
197 lines
8.5 KiB
Text
=== tests/cases/conformance/interfaces/declarationMerging/mergeThreeInterfaces.ts ===
|
|
// interfaces with the same root module should merge
|
|
|
|
// basic case
|
|
interface A {
|
|
>A : Symbol(A, Decl(mergeThreeInterfaces.ts, 0, 0), Decl(mergeThreeInterfaces.ts, 5, 1), Decl(mergeThreeInterfaces.ts, 9, 1))
|
|
|
|
foo: string;
|
|
>foo : Symbol(foo, Decl(mergeThreeInterfaces.ts, 3, 13))
|
|
}
|
|
|
|
interface A {
|
|
>A : Symbol(A, Decl(mergeThreeInterfaces.ts, 0, 0), Decl(mergeThreeInterfaces.ts, 5, 1), Decl(mergeThreeInterfaces.ts, 9, 1))
|
|
|
|
bar: number;
|
|
>bar : Symbol(bar, Decl(mergeThreeInterfaces.ts, 7, 13))
|
|
}
|
|
|
|
interface A {
|
|
>A : Symbol(A, Decl(mergeThreeInterfaces.ts, 0, 0), Decl(mergeThreeInterfaces.ts, 5, 1), Decl(mergeThreeInterfaces.ts, 9, 1))
|
|
|
|
baz: boolean;
|
|
>baz : Symbol(baz, Decl(mergeThreeInterfaces.ts, 11, 13))
|
|
}
|
|
|
|
var a: A;
|
|
>a : Symbol(a, Decl(mergeThreeInterfaces.ts, 15, 3))
|
|
>A : Symbol(A, Decl(mergeThreeInterfaces.ts, 0, 0), Decl(mergeThreeInterfaces.ts, 5, 1), Decl(mergeThreeInterfaces.ts, 9, 1))
|
|
|
|
var r1 = a.foo
|
|
>r1 : Symbol(r1, Decl(mergeThreeInterfaces.ts, 16, 3))
|
|
>a.foo : Symbol(A.foo, Decl(mergeThreeInterfaces.ts, 3, 13))
|
|
>a : Symbol(a, Decl(mergeThreeInterfaces.ts, 15, 3))
|
|
>foo : Symbol(A.foo, Decl(mergeThreeInterfaces.ts, 3, 13))
|
|
|
|
var r2 = a.bar;
|
|
>r2 : Symbol(r2, Decl(mergeThreeInterfaces.ts, 17, 3))
|
|
>a.bar : Symbol(A.bar, Decl(mergeThreeInterfaces.ts, 7, 13))
|
|
>a : Symbol(a, Decl(mergeThreeInterfaces.ts, 15, 3))
|
|
>bar : Symbol(A.bar, Decl(mergeThreeInterfaces.ts, 7, 13))
|
|
|
|
var r3 = a.baz;
|
|
>r3 : Symbol(r3, Decl(mergeThreeInterfaces.ts, 18, 3))
|
|
>a.baz : Symbol(A.baz, Decl(mergeThreeInterfaces.ts, 11, 13))
|
|
>a : Symbol(a, Decl(mergeThreeInterfaces.ts, 15, 3))
|
|
>baz : Symbol(A.baz, Decl(mergeThreeInterfaces.ts, 11, 13))
|
|
|
|
// basic generic case
|
|
interface B<T> {
|
|
>B : Symbol(B, Decl(mergeThreeInterfaces.ts, 18, 15), Decl(mergeThreeInterfaces.ts, 23, 1), Decl(mergeThreeInterfaces.ts, 27, 1))
|
|
>T : Symbol(T, Decl(mergeThreeInterfaces.ts, 21, 12), Decl(mergeThreeInterfaces.ts, 25, 12), Decl(mergeThreeInterfaces.ts, 29, 12))
|
|
|
|
foo: T;
|
|
>foo : Symbol(foo, Decl(mergeThreeInterfaces.ts, 21, 16))
|
|
>T : Symbol(T, Decl(mergeThreeInterfaces.ts, 21, 12), Decl(mergeThreeInterfaces.ts, 25, 12), Decl(mergeThreeInterfaces.ts, 29, 12))
|
|
}
|
|
|
|
interface B<T> {
|
|
>B : Symbol(B, Decl(mergeThreeInterfaces.ts, 18, 15), Decl(mergeThreeInterfaces.ts, 23, 1), Decl(mergeThreeInterfaces.ts, 27, 1))
|
|
>T : Symbol(T, Decl(mergeThreeInterfaces.ts, 21, 12), Decl(mergeThreeInterfaces.ts, 25, 12), Decl(mergeThreeInterfaces.ts, 29, 12))
|
|
|
|
bar: T;
|
|
>bar : Symbol(bar, Decl(mergeThreeInterfaces.ts, 25, 16))
|
|
>T : Symbol(T, Decl(mergeThreeInterfaces.ts, 21, 12), Decl(mergeThreeInterfaces.ts, 25, 12), Decl(mergeThreeInterfaces.ts, 29, 12))
|
|
}
|
|
|
|
interface B<T> {
|
|
>B : Symbol(B, Decl(mergeThreeInterfaces.ts, 18, 15), Decl(mergeThreeInterfaces.ts, 23, 1), Decl(mergeThreeInterfaces.ts, 27, 1))
|
|
>T : Symbol(T, Decl(mergeThreeInterfaces.ts, 21, 12), Decl(mergeThreeInterfaces.ts, 25, 12), Decl(mergeThreeInterfaces.ts, 29, 12))
|
|
|
|
baz: T;
|
|
>baz : Symbol(baz, Decl(mergeThreeInterfaces.ts, 29, 16))
|
|
>T : Symbol(T, Decl(mergeThreeInterfaces.ts, 21, 12), Decl(mergeThreeInterfaces.ts, 25, 12), Decl(mergeThreeInterfaces.ts, 29, 12))
|
|
}
|
|
|
|
var b: B<string>;
|
|
>b : Symbol(b, Decl(mergeThreeInterfaces.ts, 33, 3))
|
|
>B : Symbol(B, Decl(mergeThreeInterfaces.ts, 18, 15), Decl(mergeThreeInterfaces.ts, 23, 1), Decl(mergeThreeInterfaces.ts, 27, 1))
|
|
|
|
var r4 = b.foo
|
|
>r4 : Symbol(r4, Decl(mergeThreeInterfaces.ts, 34, 3))
|
|
>b.foo : Symbol(B.foo, Decl(mergeThreeInterfaces.ts, 21, 16))
|
|
>b : Symbol(b, Decl(mergeThreeInterfaces.ts, 33, 3))
|
|
>foo : Symbol(B.foo, Decl(mergeThreeInterfaces.ts, 21, 16))
|
|
|
|
var r5 = b.bar;
|
|
>r5 : Symbol(r5, Decl(mergeThreeInterfaces.ts, 35, 3))
|
|
>b.bar : Symbol(B.bar, Decl(mergeThreeInterfaces.ts, 25, 16))
|
|
>b : Symbol(b, Decl(mergeThreeInterfaces.ts, 33, 3))
|
|
>bar : Symbol(B.bar, Decl(mergeThreeInterfaces.ts, 25, 16))
|
|
|
|
var r6 = b.baz;
|
|
>r6 : Symbol(r6, Decl(mergeThreeInterfaces.ts, 36, 3))
|
|
>b.baz : Symbol(B.baz, Decl(mergeThreeInterfaces.ts, 29, 16))
|
|
>b : Symbol(b, Decl(mergeThreeInterfaces.ts, 33, 3))
|
|
>baz : Symbol(B.baz, Decl(mergeThreeInterfaces.ts, 29, 16))
|
|
|
|
// basic non-generic and generic case inside a module
|
|
module M {
|
|
>M : Symbol(M, Decl(mergeThreeInterfaces.ts, 36, 15))
|
|
|
|
interface A {
|
|
>A : Symbol(A, Decl(mergeThreeInterfaces.ts, 39, 10), Decl(mergeThreeInterfaces.ts, 42, 5), Decl(mergeThreeInterfaces.ts, 46, 5))
|
|
|
|
foo: string;
|
|
>foo : Symbol(foo, Decl(mergeThreeInterfaces.ts, 40, 17))
|
|
}
|
|
|
|
interface A {
|
|
>A : Symbol(A, Decl(mergeThreeInterfaces.ts, 39, 10), Decl(mergeThreeInterfaces.ts, 42, 5), Decl(mergeThreeInterfaces.ts, 46, 5))
|
|
|
|
bar: number;
|
|
>bar : Symbol(bar, Decl(mergeThreeInterfaces.ts, 44, 17))
|
|
}
|
|
|
|
interface A {
|
|
>A : Symbol(A, Decl(mergeThreeInterfaces.ts, 39, 10), Decl(mergeThreeInterfaces.ts, 42, 5), Decl(mergeThreeInterfaces.ts, 46, 5))
|
|
|
|
baz: boolean;
|
|
>baz : Symbol(baz, Decl(mergeThreeInterfaces.ts, 48, 17))
|
|
}
|
|
|
|
var a: A;
|
|
>a : Symbol(a, Decl(mergeThreeInterfaces.ts, 52, 7))
|
|
>A : Symbol(A, Decl(mergeThreeInterfaces.ts, 39, 10), Decl(mergeThreeInterfaces.ts, 42, 5), Decl(mergeThreeInterfaces.ts, 46, 5))
|
|
|
|
var r1 = a.foo;
|
|
>r1 : Symbol(r1, Decl(mergeThreeInterfaces.ts, 53, 7))
|
|
>a.foo : Symbol(A.foo, Decl(mergeThreeInterfaces.ts, 40, 17))
|
|
>a : Symbol(a, Decl(mergeThreeInterfaces.ts, 52, 7))
|
|
>foo : Symbol(A.foo, Decl(mergeThreeInterfaces.ts, 40, 17))
|
|
|
|
// BUG 856491
|
|
var r2 = a.bar; // any, should be number
|
|
>r2 : Symbol(r2, Decl(mergeThreeInterfaces.ts, 55, 7))
|
|
>a.bar : Symbol(A.bar, Decl(mergeThreeInterfaces.ts, 44, 17))
|
|
>a : Symbol(a, Decl(mergeThreeInterfaces.ts, 52, 7))
|
|
>bar : Symbol(A.bar, Decl(mergeThreeInterfaces.ts, 44, 17))
|
|
|
|
// BUG 856491
|
|
var r3 = a.baz; // any, should be boolean
|
|
>r3 : Symbol(r3, Decl(mergeThreeInterfaces.ts, 57, 7))
|
|
>a.baz : Symbol(A.baz, Decl(mergeThreeInterfaces.ts, 48, 17))
|
|
>a : Symbol(a, Decl(mergeThreeInterfaces.ts, 52, 7))
|
|
>baz : Symbol(A.baz, Decl(mergeThreeInterfaces.ts, 48, 17))
|
|
|
|
interface B<T> {
|
|
>B : Symbol(B, Decl(mergeThreeInterfaces.ts, 57, 19), Decl(mergeThreeInterfaces.ts, 61, 5), Decl(mergeThreeInterfaces.ts, 65, 5))
|
|
>T : Symbol(T, Decl(mergeThreeInterfaces.ts, 59, 16), Decl(mergeThreeInterfaces.ts, 63, 16), Decl(mergeThreeInterfaces.ts, 67, 16))
|
|
|
|
foo: T;
|
|
>foo : Symbol(foo, Decl(mergeThreeInterfaces.ts, 59, 20))
|
|
>T : Symbol(T, Decl(mergeThreeInterfaces.ts, 59, 16), Decl(mergeThreeInterfaces.ts, 63, 16), Decl(mergeThreeInterfaces.ts, 67, 16))
|
|
}
|
|
|
|
interface B<T> {
|
|
>B : Symbol(B, Decl(mergeThreeInterfaces.ts, 57, 19), Decl(mergeThreeInterfaces.ts, 61, 5), Decl(mergeThreeInterfaces.ts, 65, 5))
|
|
>T : Symbol(T, Decl(mergeThreeInterfaces.ts, 59, 16), Decl(mergeThreeInterfaces.ts, 63, 16), Decl(mergeThreeInterfaces.ts, 67, 16))
|
|
|
|
bar: T;
|
|
>bar : Symbol(bar, Decl(mergeThreeInterfaces.ts, 63, 20))
|
|
>T : Symbol(T, Decl(mergeThreeInterfaces.ts, 59, 16), Decl(mergeThreeInterfaces.ts, 63, 16), Decl(mergeThreeInterfaces.ts, 67, 16))
|
|
}
|
|
|
|
interface B<T> {
|
|
>B : Symbol(B, Decl(mergeThreeInterfaces.ts, 57, 19), Decl(mergeThreeInterfaces.ts, 61, 5), Decl(mergeThreeInterfaces.ts, 65, 5))
|
|
>T : Symbol(T, Decl(mergeThreeInterfaces.ts, 59, 16), Decl(mergeThreeInterfaces.ts, 63, 16), Decl(mergeThreeInterfaces.ts, 67, 16))
|
|
|
|
baz: T;
|
|
>baz : Symbol(baz, Decl(mergeThreeInterfaces.ts, 67, 20))
|
|
>T : Symbol(T, Decl(mergeThreeInterfaces.ts, 59, 16), Decl(mergeThreeInterfaces.ts, 63, 16), Decl(mergeThreeInterfaces.ts, 67, 16))
|
|
}
|
|
|
|
var b: B<string>;
|
|
>b : Symbol(b, Decl(mergeThreeInterfaces.ts, 71, 7))
|
|
>B : Symbol(B, Decl(mergeThreeInterfaces.ts, 57, 19), Decl(mergeThreeInterfaces.ts, 61, 5), Decl(mergeThreeInterfaces.ts, 65, 5))
|
|
|
|
var r4 = b.foo
|
|
>r4 : Symbol(r4, Decl(mergeThreeInterfaces.ts, 72, 7))
|
|
>b.foo : Symbol(B.foo, Decl(mergeThreeInterfaces.ts, 59, 20))
|
|
>b : Symbol(b, Decl(mergeThreeInterfaces.ts, 71, 7))
|
|
>foo : Symbol(B.foo, Decl(mergeThreeInterfaces.ts, 59, 20))
|
|
|
|
// BUG 856491
|
|
var r5 = b.bar; // any, should be number
|
|
>r5 : Symbol(r5, Decl(mergeThreeInterfaces.ts, 74, 7))
|
|
>b.bar : Symbol(B.bar, Decl(mergeThreeInterfaces.ts, 63, 20))
|
|
>b : Symbol(b, Decl(mergeThreeInterfaces.ts, 71, 7))
|
|
>bar : Symbol(B.bar, Decl(mergeThreeInterfaces.ts, 63, 20))
|
|
|
|
// BUG 856491
|
|
var r6 = b.baz; // any, should be boolean
|
|
>r6 : Symbol(r6, Decl(mergeThreeInterfaces.ts, 76, 7))
|
|
>b.baz : Symbol(B.baz, Decl(mergeThreeInterfaces.ts, 67, 20))
|
|
>b : Symbol(b, Decl(mergeThreeInterfaces.ts, 71, 7))
|
|
>baz : Symbol(B.baz, Decl(mergeThreeInterfaces.ts, 67, 20))
|
|
}
|