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 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
|
=== tests/cases/compiler/deepExcessPropertyCheckingWhenTargetIsIntersection.ts ===
interface StatelessComponent<P = {}> {
(props: P & { children?: number }, context?: any): null;
>props : P & { children?: number; }
>children : number
>context : any
>null : null
}
const TestComponent: StatelessComponent<TestProps> = (props) => {
>TestComponent : StatelessComponent<TestProps>
>(props) => { return null;} : (props: TestProps & { children?: number; }) => any
>props : TestProps & { children?: number; }
return null;
>null : null
}
interface ITestProps {
ariaLabel?: string;
>ariaLabel : string
}
interface NestedProp<TProps> {
props: TProps;
>props : TProps
}
interface TestProps {
icon: NestedProp<ITestProps>;
>icon : NestedProp<ITestProps>
}
TestComponent({icon: { props: { INVALID_PROP_NAME: 'share', ariaLabel: 'test label' } }});
>TestComponent({icon: { props: { INVALID_PROP_NAME: 'share', ariaLabel: 'test label' } }}) : null
>TestComponent : StatelessComponent<TestProps>
>{icon: { props: { INVALID_PROP_NAME: 'share', ariaLabel: 'test label' } }} : { icon: { props: { INVALID_PROP_NAME: string; ariaLabel: string; }; }; }
>icon : { props: { INVALID_PROP_NAME: string; ariaLabel: string; }; }
>{ props: { INVALID_PROP_NAME: 'share', ariaLabel: 'test label' } } : { props: { INVALID_PROP_NAME: string; ariaLabel: string; }; }
>props : { INVALID_PROP_NAME: string; ariaLabel: string; }
>{ INVALID_PROP_NAME: 'share', ariaLabel: 'test label' } : { INVALID_PROP_NAME: string; ariaLabel: string; }
>INVALID_PROP_NAME : string
>'share' : "share"
>ariaLabel : string
>'test label' : "test label"
const TestComponent2: StatelessComponent<TestProps | {props2: {x: number}}> = (props) => {
>TestComponent2 : StatelessComponent<TestProps | { props2: { x: number;}; }>
>props2 : { x: number; }
>x : number
>(props) => { return null;} : (props: (TestProps | { props2: { x: number;}; }) & { children?: number; }) => any
>props : (TestProps | { props2: { x: number; }; }) & { children?: number; }
return null;
>null : null
}
TestComponent2({icon: { props: { INVALID_PROP_NAME: 'share', ariaLabel: 'test label' } }});
>TestComponent2({icon: { props: { INVALID_PROP_NAME: 'share', ariaLabel: 'test label' } }}) : null
>TestComponent2 : StatelessComponent<TestProps | { props2: { x: number; }; }>
>{icon: { props: { INVALID_PROP_NAME: 'share', ariaLabel: 'test label' } }} : { icon: { props: { INVALID_PROP_NAME: string; ariaLabel: string; }; }; }
>icon : { props: { INVALID_PROP_NAME: string; ariaLabel: string; }; }
>{ props: { INVALID_PROP_NAME: 'share', ariaLabel: 'test label' } } : { props: { INVALID_PROP_NAME: string; ariaLabel: string; }; }
>props : { INVALID_PROP_NAME: string; ariaLabel: string; }
>{ INVALID_PROP_NAME: 'share', ariaLabel: 'test label' } : { INVALID_PROP_NAME: string; ariaLabel: string; }
>INVALID_PROP_NAME : string
>'share' : "share"
>ariaLabel : string
>'test label' : "test label"
|