From 24e37452960358a592c8a7526fc3d2081f78f388 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Fri, 26 Oct 2018 15:32:10 -0700 Subject: [PATCH] Add regression test --- .../cases/conformance/types/mapped/mappedTypeErrors.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/cases/conformance/types/mapped/mappedTypeErrors.ts b/tests/cases/conformance/types/mapped/mappedTypeErrors.ts index cec1fbf8395..a38979054ec 100644 --- a/tests/cases/conformance/types/mapped/mappedTypeErrors.ts +++ b/tests/cases/conformance/types/mapped/mappedTypeErrors.ts @@ -144,3 +144,13 @@ let f: Foo2 = { pf: {x: 7}, pt: {x: 7, y: false}, }; + +// Repro from #28170 + +function test1(obj: Pick) { + let x = obj.foo; // Error +} + +function test2(obj: Record) { + let x = obj.foo; // Error +}