File: identicalTypesNoDifferByCheckOrder.types

package info (click to toggle)
node-typescript 5.0.4%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 459,140 kB
  • sloc: javascript: 1,972,754; makefile: 6; sh: 1
file content (88 lines) | stat: -rw-r--r-- 2,841 bytes parent folder | download | duplicates (3)
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
=== tests/cases/compiler/identicalTypesNoDifferByCheckOrder.ts ===
interface SomeProps {
    x?: string;
>x : string | undefined

    y?: number;
>y : number | undefined

    renderAs?: FunctionComponent1<SomeProps>
>renderAs : FunctionComponent1<SomeProps> | undefined
}

type SomePropsX = Required<Pick<SomeProps, "x">> & Omit<SomeProps, "x">;
>SomePropsX : Required<Pick<SomeProps, "x">> & Omit<SomeProps, "x">

interface SomePropsClone {
    x?: string;
>x : string | undefined

    y?: number;
>y : number | undefined

    renderAs?: FunctionComponent2<SomeProps>
>renderAs : FunctionComponent2<SomeProps> | undefined
}

type SomePropsCloneX = Required<Pick<SomePropsClone, "x">> & Omit<SomePropsClone, "x">;
>SomePropsCloneX : Required<Pick<SomePropsClone, "x">> & Omit<SomePropsClone, "x">

type Validator<T> = {(): boolean, opt?: T};
>Validator : Validator<T>
>opt : T | undefined

type WeakValidationMap<T> = {[K in keyof T]?: null extends T[K] ? Validator<T[K] | null | undefined> : Validator<T[K]>};
>WeakValidationMap : WeakValidationMap<T>
>null : null
>null : null

interface FunctionComponent1<P> {
    (props: P & { children?: unknown }): void;
>props : P & { children?: unknown; }
>children : unknown

    propTypes?: WeakValidationMap<P>;
>propTypes : WeakValidationMap<P> | undefined
}

interface FunctionComponent2<P> {
    (props: P & { children?: unknown }): void;
>props : P & { children?: unknown; }
>children : unknown

    propTypes?: WeakValidationMap<P>;
>propTypes : WeakValidationMap<P> | undefined
}

function needsComponentOfSomeProps3(...x: SomePropsClone[]): void {}
>needsComponentOfSomeProps3 : (...x: SomePropsClone[]) => void
>x : SomePropsClone[]

const comp3: FunctionComponent2<SomePropsCloneX> = null as any;
>comp3 : FunctionComponent2<SomePropsCloneX>
>null as any : any
>null : null

needsComponentOfSomeProps3({ renderAs: comp3 });
>needsComponentOfSomeProps3({ renderAs: comp3 }) : void
>needsComponentOfSomeProps3 : (...x: SomePropsClone[]) => void
>{ renderAs: comp3 } : { renderAs: FunctionComponent2<SomePropsCloneX>; }
>renderAs : FunctionComponent2<SomePropsCloneX>
>comp3 : FunctionComponent2<SomePropsCloneX>

function needsComponentOfSomeProps2(...x: SomeProps[]): void {}
>needsComponentOfSomeProps2 : (...x: SomeProps[]) => void
>x : SomeProps[]

const comp2: FunctionComponent1<SomePropsX> = null as any;
>comp2 : FunctionComponent1<SomePropsX>
>null as any : any
>null : null

needsComponentOfSomeProps2({ renderAs: comp2 });
>needsComponentOfSomeProps2({ renderAs: comp2 }) : void
>needsComponentOfSomeProps2 : (...x: SomeProps[]) => void
>{ renderAs: comp2 } : { renderAs: FunctionComponent1<SomePropsX>; }
>renderAs : FunctionComponent1<SomePropsX>
>comp2 : FunctionComponent1<SomePropsX>