mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-04 21:53:42 -06:00
Add extra tests for type and value symbol merging (#55387)
This commit is contained in:
parent
cac899d44d
commit
08b2566e5b
33
tests/baselines/reference/typeValueMerge1.symbols
Normal file
33
tests/baselines/reference/typeValueMerge1.symbols
Normal 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))
|
||||
|
||||
35
tests/baselines/reference/typeValueMerge1.types
Normal file
35
tests/baselines/reference/typeValueMerge1.types
Normal 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
|
||||
|
||||
17
tests/cases/conformance/externalModules/typeValueMerge1.ts
Normal file
17
tests/cases/conformance/externalModules/typeValueMerge1.ts
Normal 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;
|
||||
Loading…
x
Reference in New Issue
Block a user