File: tsxStatelessFunctionComponentOverload2.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 (104 lines) | stat: -rw-r--r-- 3,769 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
=== tests/cases/conformance/jsx/file.tsx ===
import React = require('react')
>React : Symbol(React, Decl(file.tsx, 0, 0))

declare function OneThing(): JSX.Element;
>OneThing : Symbol(OneThing, Decl(file.tsx, 0, 31), Decl(file.tsx, 1, 41))
>JSX : Symbol(JSX, Decl(react.d.ts, 2353, 1))
>Element : Symbol(JSX.Element, Decl(react.d.ts, 2356, 27))

declare function OneThing(l: {yy: number, yy1: string}): JSX.Element;
>OneThing : Symbol(OneThing, Decl(file.tsx, 0, 31), Decl(file.tsx, 1, 41))
>l : Symbol(l, Decl(file.tsx, 2, 26))
>yy : Symbol(yy, Decl(file.tsx, 2, 30))
>yy1 : Symbol(yy1, Decl(file.tsx, 2, 41))
>JSX : Symbol(JSX, Decl(react.d.ts, 2353, 1))
>Element : Symbol(JSX.Element, Decl(react.d.ts, 2356, 27))

let obj = {
>obj : Symbol(obj, Decl(file.tsx, 4, 3))

    yy: 10,
>yy : Symbol(yy, Decl(file.tsx, 4, 11))

    yy1: "hello"
>yy1 : Symbol(yy1, Decl(file.tsx, 5, 11))
}

let obj1 = {
>obj1 : Symbol(obj1, Decl(file.tsx, 9, 3))

    yy: true
>yy : Symbol(yy, Decl(file.tsx, 9, 12))
}

let obj2 = {
>obj2 : Symbol(obj2, Decl(file.tsx, 13, 3))

    yy: 500,
>yy : Symbol(yy, Decl(file.tsx, 13, 12))

    "ignore-prop": "hello"
>"ignore-prop" : Symbol("ignore-prop", Decl(file.tsx, 14, 12))
}

let defaultObj: any;
>defaultObj : Symbol(defaultObj, Decl(file.tsx, 18, 3))

// OK
const c1 = <OneThing />
>c1 : Symbol(c1, Decl(file.tsx, 21, 5))
>OneThing : Symbol(OneThing, Decl(file.tsx, 0, 31), Decl(file.tsx, 1, 41))

const c2 = <OneThing {...obj}/>
>c2 : Symbol(c2, Decl(file.tsx, 22, 5))
>OneThing : Symbol(OneThing, Decl(file.tsx, 0, 31), Decl(file.tsx, 1, 41))
>obj : Symbol(obj, Decl(file.tsx, 4, 3))

const c3 = <OneThing {...{}} />
>c3 : Symbol(c3, Decl(file.tsx, 23, 5))
>OneThing : Symbol(OneThing, Decl(file.tsx, 0, 31), Decl(file.tsx, 1, 41))

const c4 = <OneThing {...obj1} {...obj} />
>c4 : Symbol(c4, Decl(file.tsx, 24, 5))
>OneThing : Symbol(OneThing, Decl(file.tsx, 0, 31), Decl(file.tsx, 1, 41))
>obj1 : Symbol(obj1, Decl(file.tsx, 9, 3))
>obj : Symbol(obj, Decl(file.tsx, 4, 3))

const c5 = <OneThing {...obj1} yy={42} {...{yy1: "hi"}}/>
>c5 : Symbol(c5, Decl(file.tsx, 25, 5))
>OneThing : Symbol(OneThing, Decl(file.tsx, 0, 31), Decl(file.tsx, 1, 41))
>obj1 : Symbol(obj1, Decl(file.tsx, 9, 3))
>yy : Symbol(yy, Decl(file.tsx, 25, 30))
>yy1 : Symbol(yy1, Decl(file.tsx, 25, 44))

const c6 = <OneThing {...obj1} {...{yy: 10000, yy1: "true"}} />
>c6 : Symbol(c6, Decl(file.tsx, 26, 5))
>OneThing : Symbol(OneThing, Decl(file.tsx, 0, 31), Decl(file.tsx, 1, 41))
>obj1 : Symbol(obj1, Decl(file.tsx, 9, 3))
>yy : Symbol(yy, Decl(file.tsx, 26, 36))
>yy1 : Symbol(yy1, Decl(file.tsx, 26, 46))

const c7 = <OneThing {...defaultObj} yy {...obj} />;  // No error. should pick second overload
>c7 : Symbol(c7, Decl(file.tsx, 27, 5))
>OneThing : Symbol(OneThing, Decl(file.tsx, 0, 31), Decl(file.tsx, 1, 41))
>defaultObj : Symbol(defaultObj, Decl(file.tsx, 18, 3))
>yy : Symbol(yy, Decl(file.tsx, 27, 36))
>obj : Symbol(obj, Decl(file.tsx, 4, 3))

const c8 = <OneThing ignore-prop={100} />
>c8 : Symbol(c8, Decl(file.tsx, 28, 5))
>OneThing : Symbol(OneThing, Decl(file.tsx, 0, 31), Decl(file.tsx, 1, 41))
>ignore-prop : Symbol(ignore-prop, Decl(file.tsx, 28, 20))

const c9 = <OneThing {...{ "ignore-prop":200 }} />;
>c9 : Symbol(c9, Decl(file.tsx, 29, 5))
>OneThing : Symbol(OneThing, Decl(file.tsx, 0, 31), Decl(file.tsx, 1, 41))
>"ignore-prop" : Symbol("ignore-prop", Decl(file.tsx, 29, 26))

const c10 = <OneThing {...obj2} yy1="boo" />;
>c10 : Symbol(c10, Decl(file.tsx, 30, 5))
>OneThing : Symbol(OneThing, Decl(file.tsx, 0, 31), Decl(file.tsx, 1, 41))
>obj2 : Symbol(obj2, Decl(file.tsx, 13, 3))
>yy1 : Symbol(yy1, Decl(file.tsx, 30, 31))