TypeScript/tests/baselines/reference/checkJsxChildrenProperty13.types
Anders Hejlsberg 6aeb8c12cc
Preserve type aliases for union and intersection types (#42149)
* Create separate types for equivalent aliased unions

* Accept new baselines

* Preserve original types for union types

* Accept new baselines

* Preserve intersection origin for union types

* Accept new baselines

* Accept new baselines

* Preserve aliases during relationship checks

* Accept new baselines

* Preserve aliases for intersection and indexed access types

* Accept new baselines

* Compute intersection-of-unions cross product without recursion

* Accept new baselines

* Use denormalized type objects for origin / support 'keyof' origins

* Accept new baselines

* Fix fourslash test

* Recursively extract named union types

* Accept new baselines

* Map on union origin in mapType to better preserve aliases and origins

* Remove redundant call

* Accept new baselines

* Revert back to declared type when branches produce equivalent union

* Accept new baselines

* Don't include denormal origin types in regular type statistics

* Fix issue with unions not being marked primitive-only

* Allow new alias to be associated with type alias instantiation

* Accept new baselines

* Revert "Accept new baselines"

This reverts commit 4507270cc1.

* Revert "Allow new alias to be associated with type alias instantiation"

This reverts commit 2c2d06dfe1.
2021-01-08 15:19:58 -10:00

67 lines
1.6 KiB
Plaintext

=== tests/cases/conformance/jsx/file.tsx ===
import React = require('react');
>React : typeof React
interface ButtonProp {
a: number,
>a : number
b: string,
>b : string
children: Button;
>children : Button
}
class Button extends React.Component<ButtonProp, any> {
>Button : Button
>React.Component : React.Component<ButtonProp, any>
>React : typeof React
>Component : typeof React.Component
render() {
>render : () => JSX.Element
// Error children are specified twice
return (<InnerButton {...this.props} children="hi">
>(<InnerButton {...this.props} children="hi"> <div>Hello World</div> </InnerButton>) : JSX.Element
><InnerButton {...this.props} children="hi"> <div>Hello World</div> </InnerButton> : JSX.Element
>InnerButton : typeof InnerButton
>this.props : ButtonProp & { children?: React.ReactNode | undefined; }
>this : this
>props : ButtonProp & { children?: React.ReactNode | undefined; }
>children : string
<div>Hello World</div>
><div>Hello World</div> : JSX.Element
>div : any
>div : any
</InnerButton>);
>InnerButton : typeof InnerButton
}
}
interface InnerButtonProp {
a: number
>a : number
}
class InnerButton extends React.Component<InnerButtonProp, any> {
>InnerButton : InnerButton
>React.Component : React.Component<InnerButtonProp, any>
>React : typeof React
>Component : typeof React.Component
render() {
>render : () => JSX.Element
return (<button>Hello</button>);
>(<button>Hello</button>) : JSX.Element
><button>Hello</button> : JSX.Element
>button : any
>button : any
}
}