From 4bb5cfb9bb1b371c09b08b151bb50522537726b9 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 25 Sep 2018 18:17:21 -0700 Subject: [PATCH] Add regression test --- .../typeInference/bivariantInferences.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 tests/cases/conformance/types/typeRelationships/typeInference/bivariantInferences.ts diff --git a/tests/cases/conformance/types/typeRelationships/typeInference/bivariantInferences.ts b/tests/cases/conformance/types/typeRelationships/typeInference/bivariantInferences.ts new file mode 100644 index 00000000000..c0e2ee497d0 --- /dev/null +++ b/tests/cases/conformance/types/typeRelationships/typeInference/bivariantInferences.ts @@ -0,0 +1,12 @@ +// @strict: true + +// Repro from #27337 + +interface Array { + equalsShallow(this: ReadonlyArray, other: ReadonlyArray): boolean; +} + +declare const a: (string | number)[] | null[] | undefined[] | {}[]; +declare const b: (string | number)[] | null[] | undefined[] | {}[]; + +let x = a.equalsShallow(b);