File: exportAssignmentConstrainedGenericType.symbols

package info (click to toggle)
node-typescript 3.3.3333-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 324,548 kB
  • sloc: makefile: 6; sh: 3
file content (41 lines) | stat: -rw-r--r-- 1,292 bytes parent folder | download | duplicates (5)
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
31
32
33
34
35
36
37
38
39
40
41
=== tests/cases/conformance/externalModules/foo_1.ts ===
import foo = require("./foo_0");
>foo : Symbol(foo, Decl(foo_1.ts, 0, 0))

var x = new foo(true); // Should error
>x : Symbol(x, Decl(foo_1.ts, 1, 3))
>foo : Symbol(foo, Decl(foo_1.ts, 0, 0))

var y = new foo({a: "test", b: 42}); // Should be OK
>y : Symbol(y, Decl(foo_1.ts, 2, 3))
>foo : Symbol(foo, Decl(foo_1.ts, 0, 0))
>a : Symbol(a, Decl(foo_1.ts, 2, 17))
>b : Symbol(b, Decl(foo_1.ts, 2, 27))

var z: number = y.test.b;
>z : Symbol(z, Decl(foo_1.ts, 3, 3))
>y.test.b : Symbol(b, Decl(foo_1.ts, 2, 27))
>y.test : Symbol(foo.test, Decl(foo_0.ts, 0, 44))
>y : Symbol(y, Decl(foo_1.ts, 2, 3))
>test : Symbol(foo.test, Decl(foo_0.ts, 0, 44))
>b : Symbol(b, Decl(foo_1.ts, 2, 27))

=== tests/cases/conformance/externalModules/foo_0.ts ===
class Foo<T extends {a: string; b:number;}>{
>Foo : Symbol(Foo, Decl(foo_0.ts, 0, 0))
>T : Symbol(T, Decl(foo_0.ts, 0, 10))
>a : Symbol(a, Decl(foo_0.ts, 0, 21))
>b : Symbol(b, Decl(foo_0.ts, 0, 31))

	test: T;
>test : Symbol(Foo.test, Decl(foo_0.ts, 0, 44))
>T : Symbol(T, Decl(foo_0.ts, 0, 10))

	constructor(x: T){}
>x : Symbol(x, Decl(foo_0.ts, 2, 13))
>T : Symbol(T, Decl(foo_0.ts, 0, 10))
}

export = Foo;
>Foo : Symbol(Foo, Decl(foo_0.ts, 0, 0))