<!-- 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨 Half of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker. Even if you think you've found a *bug*, please read the FAQ first, especially the Common "Bugs" That Aren't Bugs section! Please help us by doing the following steps before logging an issue: * Search: https://github.com/Microsoft/TypeScript/search?type=Issues * Read the FAQ: https://github.com/Microsoft/TypeScript/wiki/FAQ Please fill in the *entire* template below. --> <!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. --> **TypeScript Version:** 3.5.1-3.5.2 <!-- Search terms you tried before logging this (so others can find this issue more easily) --> **Search Terms:** infer type from generic function **Code** ```ts type genericProps<T> = { abcId: string count: number flag: boolean className?: string as?: T } declare function genericFC<T>(props: genericProps<T>): any type test<T> = typeof genericFC extends <T>(props: infer P) => any ? P : never ``` **Expected behavior:** ``` { abcId: string count: number flag: boolean className?: string as?: T } ``` **Actual behavior:** ``` { abcId: string count: number flag: boolean className?: string as?: unknown } ``` **Playground Link:** <!-- A link to a TypeScript Playground "Share" link which demonstrates this behavior --> [link](https://www.typescriptlang.org/play/index.html?jsx=2#code/LAKA9GAEBmCGDWBTSAjAlgOwCaYOYGdQtEBjAG1gCdkNYBbRfAB1hOQCVFWAXSAb1CQYAVwwluaAPYZIJarG6IAomUQMM3ABQBKAFyRYGAJ4BuUAF9QVkNyNNkuRBkSU0JAAqVJTfAB4AKgB8kAC8-IIGKCQAklj6+NyuGLgRJJKi3PoYwnQoLhHQFLj6KJKSqoapFPj4AHL0iAD88Yl4EbD4zZD+FtZEpBTUImIS0pCOzq4kAGIAwgGBmkxePvoTLm6e3n5BegbGkNa29pCKCQuhp3aIktDjThszs5CIAB6K2PiQC0sr+PqYaAuSDubShYKGIyQRogyBZRAAN3yIFAYAAVBE3vZxIg4ocQEIBAShJEYniEkkUsShGkMlkcnlKBEhIVYMVUGUKhhmbJqnUGl0KW1qQZOvoesTLCA0WBrEA) **Related Issues:** <!-- Did you find other bugs that looked similar? -->
Activity
RyanCavanaugh commentedon Jul 2, 2019
This is working as expected. There's no relation between the two
Ts intest's declaration; i.e. you could equally have writtenI expect what you're trying to do is refer to a specific call instantiation of a generic function, which isn't currently possible.
Pomar81 commentedon Jul 4, 2019
Yes, I wanted to refer to specific call instantiation of a generic function
e.g
genericFC<'div'>
ahejlsberg commentedon Jan 27, 2022
With #47607 it is possible to refer to specific instantiations of generic functions.