|
| 1 | +=== tests/cases/compiler/index.ts === |
| 2 | +import data from "./data.json"; |
| 3 | +>data : Symbol(data, Decl(index.ts, 0, 6)) |
| 4 | + |
| 5 | +interface Foo { |
| 6 | +>Foo : Symbol(Foo, Decl(index.ts, 0, 31)) |
| 7 | + |
| 8 | + str: string; |
| 9 | +>str : Symbol(Foo.str, Decl(index.ts, 2, 15)) |
| 10 | +} |
| 11 | + |
| 12 | +fn(data.foo); |
| 13 | +>fn : Symbol(fn, Decl(index.ts, 7, 13)) |
| 14 | +>data.foo : Symbol("foo", Decl(data.json, 0, 1)) |
| 15 | +>data : Symbol(data, Decl(index.ts, 0, 6)) |
| 16 | +>foo : Symbol("foo", Decl(data.json, 0, 1)) |
| 17 | + |
| 18 | +fn(data.foo); // <-- shouldn't error! |
| 19 | +>fn : Symbol(fn, Decl(index.ts, 7, 13)) |
| 20 | +>data.foo : Symbol("foo", Decl(data.json, 0, 1)) |
| 21 | +>data : Symbol(data, Decl(index.ts, 0, 6)) |
| 22 | +>foo : Symbol("foo", Decl(data.json, 0, 1)) |
| 23 | + |
| 24 | +function fn(arg: Foo[]) { } |
| 25 | +>fn : Symbol(fn, Decl(index.ts, 7, 13)) |
| 26 | +>arg : Symbol(arg, Decl(index.ts, 9, 12)) |
| 27 | +>Foo : Symbol(Foo, Decl(index.ts, 0, 31)) |
| 28 | + |
| 29 | +=== tests/cases/compiler/data.json === |
| 30 | +{ |
| 31 | + "foo": [ |
| 32 | +>"foo" : Symbol("foo", Decl(data.json, 0, 1)) |
| 33 | + { |
| 34 | + "bool": true, |
| 35 | +>"bool" : Symbol("bool", Decl(data.json, 2, 7)) |
| 36 | + |
| 37 | + "str": "123" |
| 38 | +>"str" : Symbol("str", Decl(data.json, 3, 21)) |
| 39 | + } |
| 40 | + ] |
| 41 | +} |
0 commit comments