Skip to content

Commit 24e3745

Browse files
committed
Add regression test
1 parent 30d1ecd commit 24e3745

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/cases/conformance/types/mapped/mappedTypeErrors.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,3 +144,13 @@ let f: Foo2<O, 'x'> = {
144144
pf: {x: 7},
145145
pt: {x: 7, y: false},
146146
};
147+
148+
// Repro from #28170
149+
150+
function test1<T, K extends keyof T>(obj: Pick<T, K>) {
151+
let x = obj.foo; // Error
152+
}
153+
154+
function test2<T, K extends keyof T>(obj: Record<K, number>) {
155+
let x = obj.foo; // Error
156+
}

0 commit comments

Comments
 (0)