Add extra tests for type and value symbol merging (#55387)

This commit is contained in:
Mateusz Burzyński 2023-08-16 22:04:35 +02:00 committed by GitHub
parent cac899d44d
commit 08b2566e5b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 85 additions and 0 deletions

View File

@ -0,0 +1,33 @@
//// [tests/cases/conformance/externalModules/typeValueMerge1.ts] ////
=== other.ts ===
export type A = string;
>A : Symbol(A, Decl(other.ts, 0, 0), Decl(other.ts, 2, 8))
function A() {}
>A : Symbol(A, Decl(other.ts, 0, 23), Decl(other.ts, 0, 0))
export { A };
>A : Symbol(A, Decl(other.ts, 0, 0), Decl(other.ts, 2, 8))
export type B = string;
>B : Symbol(B, Decl(other.ts, 2, 13), Decl(other.ts, 6, 8))
var B = 10;
>B : Symbol(B, Decl(other.ts, 2, 13), Decl(other.ts, 5, 3))
export { B };
>B : Symbol(B, Decl(other.ts, 2, 13), Decl(other.ts, 6, 8))
=== main.ts ===
import { A, B } from "./other";
>A : Symbol(A, Decl(main.ts, 0, 8))
>B : Symbol(B, Decl(main.ts, 0, 11))
A();
>A : Symbol(A, Decl(main.ts, 0, 8))
export const C = B;
>C : Symbol(C, Decl(main.ts, 4, 12))
>B : Symbol(B, Decl(main.ts, 0, 11))

View File

@ -0,0 +1,35 @@
//// [tests/cases/conformance/externalModules/typeValueMerge1.ts] ////
=== other.ts ===
export type A = string;
>A : string
function A() {}
>A : () => void
export { A };
>A : () => void
export type B = string;
>B : string
var B = 10;
>B : number
>10 : 10
export { B };
>B : number
=== main.ts ===
import { A, B } from "./other";
>A : () => void
>B : number
A();
>A() : void
>A : () => void
export const C = B;
>C : number
>B : number

View File

@ -0,0 +1,17 @@
// @noEmit: true
// @Filename: other.ts
export type A = string;
function A() {}
export { A };
export type B = string;
var B = 10;
export { B };
// @Filename: main.ts
import { A, B } from "./other";
A();
export const C = B;