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 0000000000..c0e2ee497d --- /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);