File: classFunctionMerging.symbols

package info (click to toggle)
node-typescript 5.0.4%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 459,116 kB
  • sloc: javascript: 1,972,754; makefile: 6; sh: 1
file content (30 lines) | stat: -rw-r--r-- 1,549 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
=== tests/cases/compiler/classFunctionMerging.ts ===
// We allow ambient classes and functions to merge, this way callable classes
// which are also namespaces can be represented in declaration files
declare function Foo (x: number): Foo.Inst;
>Foo : Symbol(Foo, Decl(classFunctionMerging.ts, 0, 0), Decl(classFunctionMerging.ts, 2, 43), Decl(classFunctionMerging.ts, 5, 1))
>x : Symbol(x, Decl(classFunctionMerging.ts, 2, 22))
>Foo : Symbol(Foo, Decl(classFunctionMerging.ts, 0, 0), Decl(classFunctionMerging.ts, 2, 43), Decl(classFunctionMerging.ts, 5, 1))
>Inst : Symbol(Foo.Inst, Decl(classFunctionMerging.ts, 6, 23))

declare class Foo {
>Foo : Symbol(Foo, Decl(classFunctionMerging.ts, 0, 0), Decl(classFunctionMerging.ts, 2, 43), Decl(classFunctionMerging.ts, 5, 1))

    constructor(x: string);
>x : Symbol(x, Decl(classFunctionMerging.ts, 4, 16))
}
declare namespace Foo {
>Foo : Symbol(Foo, Decl(classFunctionMerging.ts, 0, 0), Decl(classFunctionMerging.ts, 2, 43), Decl(classFunctionMerging.ts, 5, 1))

    export type Inst = number;
>Inst : Symbol(Inst, Decl(classFunctionMerging.ts, 6, 23))
}

const a = new Foo("");
>a : Symbol(a, Decl(classFunctionMerging.ts, 10, 5))
>Foo : Symbol(Foo, Decl(classFunctionMerging.ts, 0, 0), Decl(classFunctionMerging.ts, 2, 43), Decl(classFunctionMerging.ts, 5, 1))

const b = Foo(12);
>b : Symbol(b, Decl(classFunctionMerging.ts, 11, 5))
>Foo : Symbol(Foo, Decl(classFunctionMerging.ts, 0, 0), Decl(classFunctionMerging.ts, 2, 43), Decl(classFunctionMerging.ts, 5, 1))