File: tsxStatelessFunctionComponentWithDefaultTypeParameter2.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 (30 lines) | stat: -rw-r--r-- 1,012 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
=== tests/cases/conformance/jsx/file.tsx ===
import React = require('react')
>React : Symbol(React, Decl(file.tsx, 0, 0))

interface MyComponentProp {
>MyComponentProp : Symbol(MyComponentProp, Decl(file.tsx, 0, 31))

    values: string;
>values : Symbol(MyComponentProp.values, Decl(file.tsx, 2, 27))
}

function MyComponent1<T extends MyComponentProp>(attr: T) {
>MyComponent1 : Symbol(MyComponent1, Decl(file.tsx, 4, 1))
>T : Symbol(T, Decl(file.tsx, 6, 22))
>MyComponentProp : Symbol(MyComponentProp, Decl(file.tsx, 0, 31))
>attr : Symbol(attr, Decl(file.tsx, 6, 49))
>T : Symbol(T, Decl(file.tsx, 6, 22))

    return <div>attr.values</div>
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2400, 45))
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2400, 45))
}


// Error
let i1 = <MyComponent1 values={5}/>;
>i1 : Symbol(i1, Decl(file.tsx, 12, 3))
>MyComponent1 : Symbol(MyComponent1, Decl(file.tsx, 4, 1))
>values : Symbol(values, Decl(file.tsx, 12, 22))