* 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 commit4507270cc1
. * Revert "Allow new alias to be associated with type alias instantiation" This reverts commit2c2d06dfe1
.
67 lines
2.7 KiB
Plaintext
67 lines
2.7 KiB
Plaintext
tests/cases/conformance/jsx/file.tsx(24,28): error TS2551: Property 'NAme' does not exist on type 'IUser'. Did you mean 'Name'?
|
|
tests/cases/conformance/jsx/file.tsx(36,15): error TS2322: Type '(user: IUser) => Element' is not assignable to type 'boolean | any[] | ReactChild'.
|
|
Type '(user: IUser) => Element' is missing the following properties from type 'ReactElement<any>': type, props
|
|
tests/cases/conformance/jsx/file.tsx(39,15): error TS2322: Type '(user: IUser) => Element' is not assignable to type 'boolean | any[] | ReactChild'.
|
|
Type '(user: IUser) => Element' is missing the following properties from type 'ReactElement<any>': type, props
|
|
|
|
|
|
==== tests/cases/conformance/jsx/file.tsx (3 errors) ====
|
|
import React = require('react');
|
|
|
|
interface IUser {
|
|
Name: string;
|
|
}
|
|
|
|
interface IFetchUserProps {
|
|
children: (user: IUser) => JSX.Element;
|
|
}
|
|
|
|
class FetchUser extends React.Component<IFetchUserProps, any> {
|
|
render() {
|
|
return this.state
|
|
? this.props.children(this.state.result)
|
|
: null;
|
|
}
|
|
}
|
|
|
|
// Error
|
|
function UserName() {
|
|
return (
|
|
<FetchUser>
|
|
{ user => (
|
|
<h1>{ user.NAme }</h1>
|
|
~~~~
|
|
!!! error TS2551: Property 'NAme' does not exist on type 'IUser'. Did you mean 'Name'?
|
|
!!! related TS2728 tests/cases/conformance/jsx/file.tsx:4:5: 'Name' is declared here.
|
|
) }
|
|
</FetchUser>
|
|
);
|
|
}
|
|
|
|
function UserName1() {
|
|
return (
|
|
<FetchUser>
|
|
|
|
|
|
|
|
{ user => (
|
|
~~~~~~~~~
|
|
<h1>{ user.Name }</h1>
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
) }
|
|
~~~~~~~~~~~~~
|
|
!!! error TS2322: Type '(user: IUser) => Element' is not assignable to type 'boolean | any[] | ReactChild'.
|
|
!!! error TS2322: Type '(user: IUser) => Element' is missing the following properties from type 'ReactElement<any>': type, props
|
|
!!! related TS6212 tests/cases/conformance/jsx/file.tsx:36:15: Did you mean to call this expression?
|
|
{ user => (
|
|
~~~~~~~~~
|
|
<h1>{ user.Name }</h1>
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
) }
|
|
~~~~~~~~~~~~~
|
|
!!! error TS2322: Type '(user: IUser) => Element' is not assignable to type 'boolean | any[] | ReactChild'.
|
|
!!! error TS2322: Type '(user: IUser) => Element' is missing the following properties from type 'ReactElement<any>': type, props
|
|
!!! related TS6212 tests/cases/conformance/jsx/file.tsx:39:15: Did you mean to call this expression?
|
|
</FetchUser>
|
|
);
|
|
} |