From 80e3b728167efc1ceb141560bf239cb295eeacbc Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Thu, 24 Sep 2015 15:46:00 -0700 Subject: [PATCH] Adding repro from #4818 to test --- tests/cases/fourslash/parameterWithDestructuring.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/cases/fourslash/parameterWithDestructuring.ts b/tests/cases/fourslash/parameterWithDestructuring.ts index e8026125e2b..72dfefd553a 100644 --- a/tests/cases/fourslash/parameterWithDestructuring.ts +++ b/tests/cases/fourslash/parameterWithDestructuring.ts @@ -1,11 +1,22 @@ /// +// Repros from issues #4949 and #4818 + ////const result = [{ foo: 'hello' }] //// .map(({ /*1*/foo }) => /*2*/foo) //// .map(foo => foo); +//// +////const f = (foo: (bar: string[]) => void) => { }; +//// +////f(([a, b]) => { +//// /*3*/a.charAt(0); // Not okay: inferred as `any` +////}); goTo.marker('1'); verify.quickInfoIs('var foo: string'); goTo.marker('2'); verify.quickInfoIs('var foo: string'); + +goTo.marker('3'); +verify.quickInfoIs('var a: string');