142 lines
5.2 KiB
Text
142 lines
5.2 KiB
Text
=== tests/cases/conformance/interfaces/declarationMerging/mergeTwoInterfaces.ts ===
|
|
// two interfaces with the same root module should merge
|
|
|
|
// basic case
|
|
interface A {
|
|
>A : Symbol(A, Decl(mergeTwoInterfaces.ts, 0, 0), Decl(mergeTwoInterfaces.ts, 5, 1))
|
|
|
|
foo: string;
|
|
>foo : Symbol(foo, Decl(mergeTwoInterfaces.ts, 3, 13))
|
|
}
|
|
|
|
interface A {
|
|
>A : Symbol(A, Decl(mergeTwoInterfaces.ts, 0, 0), Decl(mergeTwoInterfaces.ts, 5, 1))
|
|
|
|
bar: number;
|
|
>bar : Symbol(bar, Decl(mergeTwoInterfaces.ts, 7, 13))
|
|
}
|
|
|
|
var a: A;
|
|
>a : Symbol(a, Decl(mergeTwoInterfaces.ts, 11, 3))
|
|
>A : Symbol(A, Decl(mergeTwoInterfaces.ts, 0, 0), Decl(mergeTwoInterfaces.ts, 5, 1))
|
|
|
|
var r1 = a.foo
|
|
>r1 : Symbol(r1, Decl(mergeTwoInterfaces.ts, 12, 3))
|
|
>a.foo : Symbol(A.foo, Decl(mergeTwoInterfaces.ts, 3, 13))
|
|
>a : Symbol(a, Decl(mergeTwoInterfaces.ts, 11, 3))
|
|
>foo : Symbol(A.foo, Decl(mergeTwoInterfaces.ts, 3, 13))
|
|
|
|
var r2 = a.bar;
|
|
>r2 : Symbol(r2, Decl(mergeTwoInterfaces.ts, 13, 3))
|
|
>a.bar : Symbol(A.bar, Decl(mergeTwoInterfaces.ts, 7, 13))
|
|
>a : Symbol(a, Decl(mergeTwoInterfaces.ts, 11, 3))
|
|
>bar : Symbol(A.bar, Decl(mergeTwoInterfaces.ts, 7, 13))
|
|
|
|
// basic generic case
|
|
interface B<T> {
|
|
>B : Symbol(B, Decl(mergeTwoInterfaces.ts, 13, 15), Decl(mergeTwoInterfaces.ts, 19, 1))
|
|
>T : Symbol(T, Decl(mergeTwoInterfaces.ts, 16, 12), Decl(mergeTwoInterfaces.ts, 21, 12))
|
|
|
|
baz: string;
|
|
>baz : Symbol(baz, Decl(mergeTwoInterfaces.ts, 16, 16))
|
|
|
|
foo: T;
|
|
>foo : Symbol(foo, Decl(mergeTwoInterfaces.ts, 17, 16))
|
|
>T : Symbol(T, Decl(mergeTwoInterfaces.ts, 16, 12), Decl(mergeTwoInterfaces.ts, 21, 12))
|
|
}
|
|
|
|
interface B<T> {
|
|
>B : Symbol(B, Decl(mergeTwoInterfaces.ts, 13, 15), Decl(mergeTwoInterfaces.ts, 19, 1))
|
|
>T : Symbol(T, Decl(mergeTwoInterfaces.ts, 16, 12), Decl(mergeTwoInterfaces.ts, 21, 12))
|
|
|
|
bar: T;
|
|
>bar : Symbol(bar, Decl(mergeTwoInterfaces.ts, 21, 16))
|
|
>T : Symbol(T, Decl(mergeTwoInterfaces.ts, 16, 12), Decl(mergeTwoInterfaces.ts, 21, 12))
|
|
}
|
|
|
|
var b: B<string>;
|
|
>b : Symbol(b, Decl(mergeTwoInterfaces.ts, 25, 3))
|
|
>B : Symbol(B, Decl(mergeTwoInterfaces.ts, 13, 15), Decl(mergeTwoInterfaces.ts, 19, 1))
|
|
|
|
var r3 = b.foo
|
|
>r3 : Symbol(r3, Decl(mergeTwoInterfaces.ts, 26, 3))
|
|
>b.foo : Symbol(B.foo, Decl(mergeTwoInterfaces.ts, 17, 16))
|
|
>b : Symbol(b, Decl(mergeTwoInterfaces.ts, 25, 3))
|
|
>foo : Symbol(B.foo, Decl(mergeTwoInterfaces.ts, 17, 16))
|
|
|
|
var r4 = b.bar;
|
|
>r4 : Symbol(r4, Decl(mergeTwoInterfaces.ts, 27, 3))
|
|
>b.bar : Symbol(B.bar, Decl(mergeTwoInterfaces.ts, 21, 16))
|
|
>b : Symbol(b, Decl(mergeTwoInterfaces.ts, 25, 3))
|
|
>bar : Symbol(B.bar, Decl(mergeTwoInterfaces.ts, 21, 16))
|
|
|
|
// basic non-generic and generic case inside a module
|
|
module M {
|
|
>M : Symbol(M, Decl(mergeTwoInterfaces.ts, 27, 15))
|
|
|
|
interface A {
|
|
>A : Symbol(A, Decl(mergeTwoInterfaces.ts, 30, 10), Decl(mergeTwoInterfaces.ts, 33, 5))
|
|
|
|
foo: string;
|
|
>foo : Symbol(foo, Decl(mergeTwoInterfaces.ts, 31, 17))
|
|
}
|
|
|
|
interface A {
|
|
>A : Symbol(A, Decl(mergeTwoInterfaces.ts, 30, 10), Decl(mergeTwoInterfaces.ts, 33, 5))
|
|
|
|
bar: number;
|
|
>bar : Symbol(bar, Decl(mergeTwoInterfaces.ts, 35, 17))
|
|
}
|
|
|
|
var a: A;
|
|
>a : Symbol(a, Decl(mergeTwoInterfaces.ts, 39, 7))
|
|
>A : Symbol(A, Decl(mergeTwoInterfaces.ts, 30, 10), Decl(mergeTwoInterfaces.ts, 33, 5))
|
|
|
|
var r1 = a.foo;
|
|
>r1 : Symbol(r1, Decl(mergeTwoInterfaces.ts, 40, 7))
|
|
>a.foo : Symbol(A.foo, Decl(mergeTwoInterfaces.ts, 31, 17))
|
|
>a : Symbol(a, Decl(mergeTwoInterfaces.ts, 39, 7))
|
|
>foo : Symbol(A.foo, Decl(mergeTwoInterfaces.ts, 31, 17))
|
|
|
|
// BUG 856491
|
|
var r2 = a.bar; // any, should be number
|
|
>r2 : Symbol(r2, Decl(mergeTwoInterfaces.ts, 42, 7))
|
|
>a.bar : Symbol(A.bar, Decl(mergeTwoInterfaces.ts, 35, 17))
|
|
>a : Symbol(a, Decl(mergeTwoInterfaces.ts, 39, 7))
|
|
>bar : Symbol(A.bar, Decl(mergeTwoInterfaces.ts, 35, 17))
|
|
|
|
interface B<T> {
|
|
>B : Symbol(B, Decl(mergeTwoInterfaces.ts, 42, 19), Decl(mergeTwoInterfaces.ts, 46, 5))
|
|
>T : Symbol(T, Decl(mergeTwoInterfaces.ts, 44, 16), Decl(mergeTwoInterfaces.ts, 48, 16))
|
|
|
|
foo: T;
|
|
>foo : Symbol(foo, Decl(mergeTwoInterfaces.ts, 44, 20))
|
|
>T : Symbol(T, Decl(mergeTwoInterfaces.ts, 44, 16), Decl(mergeTwoInterfaces.ts, 48, 16))
|
|
}
|
|
|
|
interface B<T> {
|
|
>B : Symbol(B, Decl(mergeTwoInterfaces.ts, 42, 19), Decl(mergeTwoInterfaces.ts, 46, 5))
|
|
>T : Symbol(T, Decl(mergeTwoInterfaces.ts, 44, 16), Decl(mergeTwoInterfaces.ts, 48, 16))
|
|
|
|
bar: T;
|
|
>bar : Symbol(bar, Decl(mergeTwoInterfaces.ts, 48, 20))
|
|
>T : Symbol(T, Decl(mergeTwoInterfaces.ts, 44, 16), Decl(mergeTwoInterfaces.ts, 48, 16))
|
|
}
|
|
|
|
var b: B<string>;
|
|
>b : Symbol(b, Decl(mergeTwoInterfaces.ts, 52, 7))
|
|
>B : Symbol(B, Decl(mergeTwoInterfaces.ts, 42, 19), Decl(mergeTwoInterfaces.ts, 46, 5))
|
|
|
|
var r3 = b.foo
|
|
>r3 : Symbol(r3, Decl(mergeTwoInterfaces.ts, 53, 7))
|
|
>b.foo : Symbol(B.foo, Decl(mergeTwoInterfaces.ts, 44, 20))
|
|
>b : Symbol(b, Decl(mergeTwoInterfaces.ts, 52, 7))
|
|
>foo : Symbol(B.foo, Decl(mergeTwoInterfaces.ts, 44, 20))
|
|
|
|
// BUG 856491
|
|
var r4 = b.bar; // any, should be string
|
|
>r4 : Symbol(r4, Decl(mergeTwoInterfaces.ts, 55, 7))
|
|
>b.bar : Symbol(B.bar, Decl(mergeTwoInterfaces.ts, 48, 20))
|
|
>b : Symbol(b, Decl(mergeTwoInterfaces.ts, 52, 7))
|
|
>bar : Symbol(B.bar, Decl(mergeTwoInterfaces.ts, 48, 20))
|
|
}
|