From 83020dbbd6c43ecdbebe7bf6a65b573eb6038aa3 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 10 Oct 2017 17:34:32 -0700 Subject: [PATCH] Add regression test --- .../indirectTypeParameterReferences.ts | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 tests/cases/compiler/indirectTypeParameterReferences.ts diff --git a/tests/cases/compiler/indirectTypeParameterReferences.ts b/tests/cases/compiler/indirectTypeParameterReferences.ts new file mode 100644 index 00000000000..210a599354d --- /dev/null +++ b/tests/cases/compiler/indirectTypeParameterReferences.ts @@ -0,0 +1,24 @@ +// Repro from #19043 + +type B = {b: string} + +const flowtypes = (b: B) => { + type Combined = A & B + + const combined = (fn: (combined: Combined) => void) => null + const literal = (fn: (aPlusB: A & B) => void) => null + + return {combined, literal} +} + +const {combined, literal} = flowtypes<{a: string}>({b: 'b-value'}) + +literal(aPlusB => { + aPlusB.b + aPlusB.a +}) + +combined(comb => { + comb.b + comb.a +})