2018-12-28 20:38:19 +01:00
|
|
|
// @strict: true
|
|
|
|
|
2018-12-13 00:39:32 +01:00
|
|
|
interface SFC<P = {}> {
|
|
|
|
(props: P & { children?: any }): any | null;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface Props {
|
|
|
|
name: "Apollo" | "Artemis" | "Dionysus" | "Persephone";
|
|
|
|
}
|
|
|
|
|
|
|
|
const Parent: SFC<Props> = ({
|
|
|
|
children,
|
|
|
|
name = "Artemis",
|
|
|
|
...props
|
|
|
|
}) => Child({name, ...props});
|
|
|
|
|
|
|
|
const Child: SFC<Props> = ({
|
|
|
|
children,
|
|
|
|
name = "Artemis",
|
|
|
|
...props
|
2018-12-28 20:38:19 +01:00
|
|
|
}) => `name: ${name} props: ${JSON.stringify(props)}`;
|
|
|
|
|
|
|
|
// Repro from #29189
|
|
|
|
|
|
|
|
declare function f(g: (as: string[]) => void): void
|
|
|
|
f(([_1, _2 = undefined]) => undefined)
|