From 32ea3b2cb0539e49389a23009ffe0c125f37c4c6 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Wed, 26 Sep 2018 11:09:19 -0700 Subject: [PATCH] Add regression test --- tests/cases/compiler/controlFlowInstanceof.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/cases/compiler/controlFlowInstanceof.ts b/tests/cases/compiler/controlFlowInstanceof.ts index 56f3ff97e4c..f9cf844572f 100644 --- a/tests/cases/compiler/controlFlowInstanceof.ts +++ b/tests/cases/compiler/controlFlowInstanceof.ts @@ -1,4 +1,5 @@ // @target: es6 +// @strictNullChecks: true // Repros from #10167 @@ -96,4 +97,13 @@ function goo(x: X) { x.y; } x; -} \ No newline at end of file +} + +// Repro from #27282 + +declare const x: (() => void)|null; +declare const ctor: Function; + +if (x instanceof ctor) { + x(); +}