Parameters
returns never
when used with a generic function that combines Pick
and Partial
on the generic type argument
#61516
Labels
Milestone
π Search Terms
partial pick generic parameters never
π Version & Regression Information
β― Playground Link
https://www.typescriptlang.org/play/?ts=5.9.0-dev.20250331#code/C4TwDgpgBA8gRgKygXgFBSgHygbyqSALigHIBDEgGigEsATYgZ2ACcaA7Ac2rKdY85QAvuiy584CMRJwqtBlGZsu1OMXYBXALZwILYQG5UqDsD0AzMgGNoAQQAKASVyiA7gHsWAa0YAeACpQEAAeZux0jLCIAHwAFKIY7ojE-pSiAJTEAG7u9EaiZAA2jO4A6p4+AUGhEOGR8AhxCVBJCMT2NFZeAdQkBBAkYiT0JNFpGJlQOXnGGEUltsVlFX6BIWERUY3xGInJUPZkLMA0RQHRGdm5dPkYdO4QjOzA5d5V67WbDU27LfsdXR6pH6g2wwzooygADIDkcTmd-BcJlcZiJUP0oK8fIcWGQtJFkLDcVoIGYWH4HI4ANokDzeRgkAC60QMvzZ7IwAHpOVAqa1iA1GejJFBFiUsYwcXiCUS8aS9BSnDT5st6UyWRyuTy+f9Ot0GtQAET9Q1iQ30Q3RIUYsXuW0SqX4lCyklkxXU8hLe0rdWs7m8-lE+GFXzfa0igAiDyeLwqjpljvl5N8lJp90ezyxvo5-vYECyeiAA
π» Code
π Actual behavior
Parameters<API['doesntWork']>
returnsnever
π Expected behavior
The
Parameters<API['doesntWork']>
case behaves like the other cases and returns[obj: Pick<Obj, "type" | "id"> & Partial<Obj>]
.Additional information about the issue
I'm not sure why
Parameters
works for all cases except whenPick
andPartial
are used together. I'm having the same problem when usingextends
andinfer
to get the parameters.My use case is to prepend an argument
event: IpcMainInvokeEvent
to several generic functions to match the signature expected by thelistener
argument of Electron'sipcMain.handle
method. If anyone knows of a workaround for thisParameters
problem, I'd love to hear it.The text was updated successfully, but these errors were encountered: