From 2f4c8ebf13559bf774326908240cc19d62427af9 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 19 Dec 2017 19:58:28 -0800 Subject: [PATCH] Add regression test --- .../compiler/unionSignaturesWithThisParameter.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 tests/cases/compiler/unionSignaturesWithThisParameter.ts diff --git a/tests/cases/compiler/unionSignaturesWithThisParameter.ts b/tests/cases/compiler/unionSignaturesWithThisParameter.ts new file mode 100644 index 0000000000..c983ff1a99 --- /dev/null +++ b/tests/cases/compiler/unionSignaturesWithThisParameter.ts @@ -0,0 +1,13 @@ +// @strict: true + +// Repro from #20802 + +function x(ctor: { + (this: {}, v: T): void; + new(v: T): void; +} | { + (v: T): void; + new(v: T): void; +}, t: T) { + new ctor(t); +}