mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
121 lines
3.6 KiB
Plaintext
121 lines
3.6 KiB
Plaintext
//// [tests/cases/conformance/jsx/checkJsxChildrenProperty6.tsx] ////
|
|
|
|
=== file.tsx ===
|
|
/// <reference path="react.d.ts" />
|
|
|
|
import React = require('react');
|
|
>React : Symbol(React, Decl(file.tsx, 0, 0))
|
|
|
|
interface Prop {
|
|
>Prop : Symbol(Prop, Decl(file.tsx, 2, 32))
|
|
|
|
a: number,
|
|
>a : Symbol(Prop.a, Decl(file.tsx, 4, 16))
|
|
|
|
b: string,
|
|
>b : Symbol(Prop.b, Decl(file.tsx, 5, 14))
|
|
|
|
children: JSX.Element | JSX.Element[];
|
|
>children : Symbol(Prop.children, Decl(file.tsx, 6, 14))
|
|
>JSX : Symbol(JSX, Decl(react.d.ts, 2355, 1))
|
|
>Element : Symbol(JSX.Element, Decl(react.d.ts, 2358, 27))
|
|
>JSX : Symbol(JSX, Decl(react.d.ts, 2355, 1))
|
|
>Element : Symbol(JSX.Element, Decl(react.d.ts, 2358, 27))
|
|
}
|
|
|
|
class Button extends React.Component<any, any> {
|
|
>Button : Symbol(Button, Decl(file.tsx, 8, 1))
|
|
>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))
|
|
|
|
render() {
|
|
>render : Symbol(Button.render, Decl(file.tsx, 10, 48))
|
|
|
|
return (<div>My Button</div>)
|
|
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2402, 45))
|
|
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2402, 45))
|
|
}
|
|
}
|
|
|
|
function AnotherButton(p: any) {
|
|
>AnotherButton : Symbol(AnotherButton, Decl(file.tsx, 14, 1))
|
|
>p : Symbol(p, Decl(file.tsx, 16, 23))
|
|
|
|
return <h1>Just Another Button</h1>;
|
|
>h1 : Symbol(JSX.IntrinsicElements.h1, Decl(react.d.ts, 2412, 47))
|
|
>h1 : Symbol(JSX.IntrinsicElements.h1, Decl(react.d.ts, 2412, 47))
|
|
}
|
|
|
|
function Comp(p: Prop) {
|
|
>Comp : Symbol(Comp, Decl(file.tsx, 18, 1))
|
|
>p : Symbol(p, Decl(file.tsx, 20, 14))
|
|
>Prop : Symbol(Prop, Decl(file.tsx, 2, 32))
|
|
|
|
return <div>{p.b}</div>;
|
|
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2402, 45))
|
|
>p.b : Symbol(Prop.b, Decl(file.tsx, 5, 14))
|
|
>p : Symbol(p, Decl(file.tsx, 20, 14))
|
|
>b : Symbol(Prop.b, Decl(file.tsx, 5, 14))
|
|
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2402, 45))
|
|
}
|
|
|
|
// Ok
|
|
let k1 =
|
|
>k1 : Symbol(k1, Decl(file.tsx, 25, 3))
|
|
|
|
<Comp a={10} b="hi">
|
|
>Comp : Symbol(Comp, Decl(file.tsx, 18, 1))
|
|
>a : Symbol(a, Decl(file.tsx, 26, 9))
|
|
>b : Symbol(b, Decl(file.tsx, 26, 16))
|
|
|
|
<Button />
|
|
>Button : Symbol(Button, Decl(file.tsx, 8, 1))
|
|
|
|
<AnotherButton />
|
|
>AnotherButton : Symbol(AnotherButton, Decl(file.tsx, 14, 1))
|
|
|
|
</Comp>;
|
|
>Comp : Symbol(Comp, Decl(file.tsx, 18, 1))
|
|
|
|
let k2 =
|
|
>k2 : Symbol(k2, Decl(file.tsx, 31, 3))
|
|
|
|
<Comp a={10} b="hi">
|
|
>Comp : Symbol(Comp, Decl(file.tsx, 18, 1))
|
|
>a : Symbol(a, Decl(file.tsx, 32, 9))
|
|
>b : Symbol(b, Decl(file.tsx, 32, 16))
|
|
|
|
|
|
|
|
<Button />
|
|
>Button : Symbol(Button, Decl(file.tsx, 8, 1))
|
|
|
|
<AnotherButton />
|
|
>AnotherButton : Symbol(AnotherButton, Decl(file.tsx, 14, 1))
|
|
|
|
</Comp>;
|
|
>Comp : Symbol(Comp, Decl(file.tsx, 18, 1))
|
|
|
|
let k3 = <Comp a={10} b="hi"><Button />
|
|
>k3 : Symbol(k3, Decl(file.tsx, 40, 3))
|
|
>Comp : Symbol(Comp, Decl(file.tsx, 18, 1))
|
|
>a : Symbol(a, Decl(file.tsx, 40, 14))
|
|
>b : Symbol(b, Decl(file.tsx, 40, 21))
|
|
>Button : Symbol(Button, Decl(file.tsx, 8, 1))
|
|
|
|
<AnotherButton />
|
|
>AnotherButton : Symbol(AnotherButton, Decl(file.tsx, 14, 1))
|
|
|
|
</Comp>;
|
|
>Comp : Symbol(Comp, Decl(file.tsx, 18, 1))
|
|
|
|
let k4 = <Comp a={10} b="hi"><Button /></Comp>;
|
|
>k4 : Symbol(k4, Decl(file.tsx, 44, 3))
|
|
>Comp : Symbol(Comp, Decl(file.tsx, 18, 1))
|
|
>a : Symbol(a, Decl(file.tsx, 44, 14))
|
|
>b : Symbol(b, Decl(file.tsx, 44, 21))
|
|
>Button : Symbol(Button, Decl(file.tsx, 8, 1))
|
|
>Comp : Symbol(Comp, Decl(file.tsx, 18, 1))
|
|
|