mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-23 10:29:01 -06:00
Add regression test
This commit is contained in:
parent
e0082f6bfc
commit
caa89cafde
@ -0,0 +1,29 @@
|
||||
// @strict
|
||||
|
||||
// Repro from #29520
|
||||
|
||||
type Test<K extends keyof any> = {
|
||||
[P in K | "foo"]: P extends "foo" ? true : () => any
|
||||
}
|
||||
|
||||
function test<T extends Test<keyof T>>(arg: T) {
|
||||
return arg;
|
||||
}
|
||||
|
||||
const res1 = test({
|
||||
foo: true,
|
||||
bar() {
|
||||
}
|
||||
});
|
||||
|
||||
const res2 = test({
|
||||
foo: true,
|
||||
bar: function () {
|
||||
}
|
||||
});
|
||||
|
||||
const res3 = test({
|
||||
foo: true,
|
||||
bar: () => {
|
||||
}
|
||||
});
|
||||
Loading…
x
Reference in New Issue
Block a user