From c53246fa35bb0e8f931042240e0fe28d5c34f31a Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Thu, 11 Jul 2019 10:47:27 -1000 Subject: [PATCH] Add regression test --- .../typeInferenceCacheInvalidation.ts | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tests/cases/compiler/typeInferenceCacheInvalidation.ts diff --git a/tests/cases/compiler/typeInferenceCacheInvalidation.ts b/tests/cases/compiler/typeInferenceCacheInvalidation.ts new file mode 100644 index 00000000000..d037f139ec5 --- /dev/null +++ b/tests/cases/compiler/typeInferenceCacheInvalidation.ts @@ -0,0 +1,23 @@ +// @strict: true + +// Repro from #32230 + +type Callback = (foo: TFoo, bar: TBar) => any + +declare function example>( + foo: TFoo, + callback: TCallback, + bar: TBar, +): TCallback + +example(42, (foo, bar) => ({ + t: () => { + let s: string = bar; + } +}), '42'); + +example(42, (foo, bar) => ({ + t() { + let s: string = bar; + } +}), '42');