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

interface Prop {
>Prop : Symbol(Prop, Decl(file.tsx, 0, 32))

    a: number,
>a : Symbol(Prop.a, Decl(file.tsx, 2, 16))

    b: string
>b : Symbol(Prop.b, Decl(file.tsx, 3, 14))
}

declare class MyComp<P extends Prop> extends React.Component<P, {}> {
>MyComp : Symbol(MyComp, Decl(file.tsx, 5, 1))
>P : Symbol(P, Decl(file.tsx, 7, 21))
>Prop : Symbol(Prop, Decl(file.tsx, 0, 32))
>React.Component : Symbol(React.Component, Decl(react.d.ts, 158, 55), Decl(react.d.ts, 161, 66))
>React : Symbol(React, Decl(file.tsx, 0, 0))
>Component : Symbol(React.Component, Decl(react.d.ts, 158, 55), Decl(react.d.ts, 161, 66))
>P : Symbol(P, Decl(file.tsx, 7, 21))

    internalProp: P;
>internalProp : Symbol(MyComp.internalProp, Decl(file.tsx, 7, 69))
>P : Symbol(P, Decl(file.tsx, 7, 21))
}

// Error
let x1 = <MyComp />
>x1 : Symbol(x1, Decl(file.tsx, 12, 3))
>MyComp : Symbol(MyComp, Decl(file.tsx, 5, 1))

// OK
let x = <MyComp a={10} b="hi" />
>x : Symbol(x, Decl(file.tsx, 15, 3))
>MyComp : Symbol(MyComp, Decl(file.tsx, 5, 1))
>a : Symbol(a, Decl(file.tsx, 15, 15))
>b : Symbol(b, Decl(file.tsx, 15, 22))

// Error
let x2 = <MyComp a="hi"/>
>x2 : Symbol(x2, Decl(file.tsx, 18, 3))
>MyComp : Symbol(MyComp, Decl(file.tsx, 5, 1))
>a : Symbol(a, Decl(file.tsx, 18, 16))