2 - Return Type
<details> <summary>✍️ Answers</summary> Name your title starting with the question no you are trying to answer. For example: `#12 - my one-line solution` </details> ```ts type MyReturnType<T extends Function> = T extends (...args: any) => infer R ? R : never ``` Extend readings: - [Type inference in conditional types (Original PR)](https://github.com/Microsoft/TypeScript/pull/21496) - [TypeScript Tutorial - 'infer' keyword](https://dev.to/aexol/typescript-tutorial-infer-keyword-2cn) - 🇨🇳 [深入理解 TypeScript - Infer](https://jkchao.github.io/typescript-book-chinese/tips/infer.html)
Posted by antfu on Jul 25, 2020, 10:05 AM
Tags
Related issues
- [Meta] Feedback on granular control over Copilot changes
- unexpected status 401 Unauthorized issue
- [MODEL] Measurable quality regression in Claude generation 5 (Fable 5 / Opus 5 / Sonnet 5): worse nonsense detection, ~2x verbosity, under-disclosed model fallb
- [CRITICAL] Subagent spawning and subagent pattern bugs trigger infinite recursion, infinite token usage, grossly inefficient token usage, and lost accumulated s
- Video stops playing after some minutes
- [MODEL] Claude verbose code comments by default — ignores instructions to stop.
Raise real-world problems, find people facing the same issue, and discuss solutions.3,500 issues0 comments
github (Software)
[Meta] Feedback on granular control over Copilot changes
unexpected status 401 Unauthorized issue
[MODEL] Measurable quality regression in Claude generation 5 (Fable 5 / Opus 5 / Sonnet 5): worse nonsense detection, ~2x verbosity, under-disclosed model fallb
[CRITICAL] Subagent spawning and subagent pattern bugs trigger infinite recursion, infinite token usage, grossly inefficient token usage, and lost accumulated s
Video stops playing after some minutes
[MODEL] Claude verbose code comments by default — ignores instructions to stop.
Scope Codex VS Code chats to the current workspace/project
Update on "Co-authored-by: Copilot" in commit messages
2 - Return Type
<details> <summary>✍️ Answers</summary> Name your title starting with the question no you are trying to answer. For example: `#12 - my one-line solution` </details> ```ts type MyReturnType<T extends Function> = T extends (...args: any) => infer R ? R : never ``` Extend readings: - [Type inference in conditional types (Original PR)](https://github.com/Microsoft/TypeScript/pull/21496) - [TypeScript Tutorial - 'infer' keyword](https://dev.to/aexol/typescript-tutorial-infer-keyword-2cn) - 🇨🇳 [深入理解 TypeScript - Infer](https://jkchao.github.io/typescript-book-chinese/tips/infer.html)
Comments (0)
No comments yet. Start the discussion.