|
| 1 | +=== tests/cases/compiler/file1.d.ts === |
| 2 | +declare module "file1" { |
| 3 | + function foo(): void; |
| 4 | +>foo : Symbol(, Decl(file1.d.ts, 0, 24), Decl(file1.d.ts, 1, 25), Decl(file2.ts, 2, 8)) |
| 5 | + |
| 6 | + namespace foo { |
| 7 | +>foo : Symbol(, Decl(file1.d.ts, 0, 24), Decl(file1.d.ts, 1, 25), Decl(file2.ts, 2, 8)) |
| 8 | + |
| 9 | + export var v: number; |
| 10 | +>v : Symbol(v, Decl(file1.d.ts, 3, 18)) |
| 11 | + } |
| 12 | + export = foo; |
| 13 | +>foo : Symbol(foo, Decl(file1.d.ts, 0, 24), Decl(file1.d.ts, 1, 25)) |
| 14 | +} |
| 15 | + |
| 16 | + |
| 17 | +=== tests/cases/compiler/file2.ts === |
| 18 | +/// <reference path="file1.d.ts"/> |
| 19 | +import x = require("file1"); |
| 20 | +>x : Symbol(x, Decl(file2.ts, 0, 0)) |
| 21 | + |
| 22 | +x.b = 1; |
| 23 | +>x.b : Symbol(x.b, Decl(file2.ts, 7, 7)) |
| 24 | +>x : Symbol(x, Decl(file2.ts, 0, 0)) |
| 25 | +>b : Symbol(x.b, Decl(file2.ts, 7, 7)) |
| 26 | + |
| 27 | +// OK - './file1' is a namespace |
| 28 | +declare module "file1" { |
| 29 | + interface A { a } |
| 30 | +>A : Symbol(A, Decl(file2.ts, 5, 24)) |
| 31 | +>a : Symbol(A.a, Decl(file2.ts, 6, 17)) |
| 32 | + |
| 33 | + let b: number; |
| 34 | +>b : Symbol(b, Decl(file2.ts, 7, 7)) |
| 35 | +} |
| 36 | + |
| 37 | +=== tests/cases/compiler/file3.ts === |
| 38 | +import * as x from "file1"; |
| 39 | +>x : Symbol(x, Decl(file3.ts, 0, 6)) |
| 40 | + |
| 41 | +import "file2"; |
| 42 | +let a: x.A; |
| 43 | +>a : Symbol(a, Decl(file3.ts, 2, 3)) |
| 44 | +>x : Symbol(x, Decl(file3.ts, 0, 6)) |
| 45 | +>A : Symbol(x.A, Decl(file2.ts, 5, 24)) |
| 46 | + |
| 47 | +let b = x.b; |
| 48 | +>b : Symbol(b, Decl(file3.ts, 3, 3)) |
| 49 | +>x.b : Symbol(x.b, Decl(file2.ts, 7, 7)) |
| 50 | +>x : Symbol(x, Decl(file3.ts, 0, 6)) |
| 51 | +>b : Symbol(x.b, Decl(file2.ts, 7, 7)) |
| 52 | + |
0 commit comments