|
| 1 | +=== tests/cases/compiler/destructuringInitializerContextualTypeFromContext.ts === |
| 2 | +interface SFC<P = {}> { |
| 3 | +>SFC : Symbol(SFC, Decl(destructuringInitializerContextualTypeFromContext.ts, 0, 0)) |
| 4 | +>P : Symbol(P, Decl(destructuringInitializerContextualTypeFromContext.ts, 0, 14)) |
| 5 | + |
| 6 | + (props: P & { children?: any }): any | null; |
| 7 | +>props : Symbol(props, Decl(destructuringInitializerContextualTypeFromContext.ts, 1, 5)) |
| 8 | +>P : Symbol(P, Decl(destructuringInitializerContextualTypeFromContext.ts, 0, 14)) |
| 9 | +>children : Symbol(children, Decl(destructuringInitializerContextualTypeFromContext.ts, 1, 17)) |
| 10 | +} |
| 11 | + |
| 12 | +interface Props { |
| 13 | +>Props : Symbol(Props, Decl(destructuringInitializerContextualTypeFromContext.ts, 2, 1)) |
| 14 | + |
| 15 | + name: "Apollo" | "Artemis" | "Dionysus" | "Persephone"; |
| 16 | +>name : Symbol(Props.name, Decl(destructuringInitializerContextualTypeFromContext.ts, 4, 17)) |
| 17 | +} |
| 18 | + |
| 19 | +const Parent: SFC<Props> = ({ |
| 20 | +>Parent : Symbol(Parent, Decl(destructuringInitializerContextualTypeFromContext.ts, 8, 5)) |
| 21 | +>SFC : Symbol(SFC, Decl(destructuringInitializerContextualTypeFromContext.ts, 0, 0)) |
| 22 | +>Props : Symbol(Props, Decl(destructuringInitializerContextualTypeFromContext.ts, 2, 1)) |
| 23 | + |
| 24 | + children, |
| 25 | +>children : Symbol(children, Decl(destructuringInitializerContextualTypeFromContext.ts, 8, 29)) |
| 26 | + |
| 27 | + name = "Artemis", |
| 28 | +>name : Symbol(name, Decl(destructuringInitializerContextualTypeFromContext.ts, 9, 13)) |
| 29 | + |
| 30 | + ...props |
| 31 | +>props : Symbol(props, Decl(destructuringInitializerContextualTypeFromContext.ts, 10, 21)) |
| 32 | + |
| 33 | +}) => Child({name, ...props}); |
| 34 | +>Child : Symbol(Child, Decl(destructuringInitializerContextualTypeFromContext.ts, 14, 5)) |
| 35 | +>name : Symbol(name, Decl(destructuringInitializerContextualTypeFromContext.ts, 12, 13)) |
| 36 | +>props : Symbol(props, Decl(destructuringInitializerContextualTypeFromContext.ts, 10, 21)) |
| 37 | + |
| 38 | +const Child: SFC<Props> = ({ |
| 39 | +>Child : Symbol(Child, Decl(destructuringInitializerContextualTypeFromContext.ts, 14, 5)) |
| 40 | +>SFC : Symbol(SFC, Decl(destructuringInitializerContextualTypeFromContext.ts, 0, 0)) |
| 41 | +>Props : Symbol(Props, Decl(destructuringInitializerContextualTypeFromContext.ts, 2, 1)) |
| 42 | + |
| 43 | + children, |
| 44 | +>children : Symbol(children, Decl(destructuringInitializerContextualTypeFromContext.ts, 14, 28)) |
| 45 | + |
| 46 | + name = "Artemis", |
| 47 | +>name : Symbol(name, Decl(destructuringInitializerContextualTypeFromContext.ts, 15, 13)) |
| 48 | + |
| 49 | + ...props |
| 50 | +>props : Symbol(props, Decl(destructuringInitializerContextualTypeFromContext.ts, 16, 21)) |
| 51 | + |
| 52 | +}) => `name: ${name} props: ${JSON.stringify(props)}`; |
| 53 | +>name : Symbol(name, Decl(destructuringInitializerContextualTypeFromContext.ts, 15, 13)) |
| 54 | +>JSON.stringify : Symbol(JSON.stringify, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) |
| 55 | +>JSON : Symbol(JSON, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) |
| 56 | +>stringify : Symbol(JSON.stringify, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) |
| 57 | +>props : Symbol(props, Decl(destructuringInitializerContextualTypeFromContext.ts, 16, 21)) |
| 58 | + |
0 commit comments