From 7f4d1ac475a776d2e7f1eecf8f312b438eff23d1 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Fri, 28 Dec 2018 09:38:19 -1000 Subject: [PATCH] Add regression test --- .../destructuringInitializerContextualTypeFromContext.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/cases/compiler/destructuringInitializerContextualTypeFromContext.ts b/tests/cases/compiler/destructuringInitializerContextualTypeFromContext.ts index 6153b1e3a80..6b109e22271 100644 --- a/tests/cases/compiler/destructuringInitializerContextualTypeFromContext.ts +++ b/tests/cases/compiler/destructuringInitializerContextualTypeFromContext.ts @@ -1,3 +1,5 @@ +// @strict: true + interface SFC

{ (props: P & { children?: any }): any | null; } @@ -16,4 +18,9 @@ const Child: SFC = ({ children, name = "Artemis", ...props -}) => `name: ${name} props: ${JSON.stringify(props)}`; \ No newline at end of file +}) => `name: ${name} props: ${JSON.stringify(props)}`; + +// Repro from #29189 + +declare function f(g: (as: string[]) => void): void +f(([_1, _2 = undefined]) => undefined)