Skip to content

Commit 08b2566

Browse files
authored
Add extra tests for type and value symbol merging (#55387)
1 parent cac899d commit 08b2566

File tree

3 files changed

+85
-0
lines changed

3 files changed

+85
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
//// [tests/cases/conformance/externalModules/typeValueMerge1.ts] ////
2+
3+
=== other.ts ===
4+
export type A = string;
5+
>A : Symbol(A, Decl(other.ts, 0, 0), Decl(other.ts, 2, 8))
6+
7+
function A() {}
8+
>A : Symbol(A, Decl(other.ts, 0, 23), Decl(other.ts, 0, 0))
9+
10+
export { A };
11+
>A : Symbol(A, Decl(other.ts, 0, 0), Decl(other.ts, 2, 8))
12+
13+
export type B = string;
14+
>B : Symbol(B, Decl(other.ts, 2, 13), Decl(other.ts, 6, 8))
15+
16+
var B = 10;
17+
>B : Symbol(B, Decl(other.ts, 2, 13), Decl(other.ts, 5, 3))
18+
19+
export { B };
20+
>B : Symbol(B, Decl(other.ts, 2, 13), Decl(other.ts, 6, 8))
21+
22+
=== main.ts ===
23+
import { A, B } from "./other";
24+
>A : Symbol(A, Decl(main.ts, 0, 8))
25+
>B : Symbol(B, Decl(main.ts, 0, 11))
26+
27+
A();
28+
>A : Symbol(A, Decl(main.ts, 0, 8))
29+
30+
export const C = B;
31+
>C : Symbol(C, Decl(main.ts, 4, 12))
32+
>B : Symbol(B, Decl(main.ts, 0, 11))
33+
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
//// [tests/cases/conformance/externalModules/typeValueMerge1.ts] ////
2+
3+
=== other.ts ===
4+
export type A = string;
5+
>A : string
6+
7+
function A() {}
8+
>A : () => void
9+
10+
export { A };
11+
>A : () => void
12+
13+
export type B = string;
14+
>B : string
15+
16+
var B = 10;
17+
>B : number
18+
>10 : 10
19+
20+
export { B };
21+
>B : number
22+
23+
=== main.ts ===
24+
import { A, B } from "./other";
25+
>A : () => void
26+
>B : number
27+
28+
A();
29+
>A() : void
30+
>A : () => void
31+
32+
export const C = B;
33+
>C : number
34+
>B : number
35+
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// @noEmit: true
2+
3+
// @Filename: other.ts
4+
export type A = string;
5+
function A() {}
6+
export { A };
7+
8+
export type B = string;
9+
var B = 10;
10+
export { B };
11+
12+
// @Filename: main.ts
13+
import { A, B } from "./other";
14+
15+
A();
16+
17+
export const C = B;

0 commit comments

Comments
 (0)