fix(bindCallback): add better type overloads#3480
Conversation
|
This seemed similar to something that bit me a few months ago, but it appears that re-ordering won't help, here. |
|
Blocked by microsoft/TypeScript#22952 |
|
@benlesh I think you can disregard the amendment I made to the comment above. It most likely is only the ordering that's the problem. I messed up my minimal repro and bound a generic function: declare function func<T>(callback: (t: T) => void): void;
declare function bindCallback<T>(f: (callback: (t: T) => void) => void): T;
const result = bindCallback(func); // inferred as {}I'm such a doofus. 😬 |
This is currently blocked, as it doesn't seem that TypeScript can really handle inferring types here like I hoped it could
4112fc3 to
beccf84
Compare
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This is currently blocked, as it doesn't seem that TypeScript can really handle inferring types here like I hoped it could