Skip to content

Instantly share code, notes, and snippets.

@schotime
Last active October 12, 2017 06:23
Show Gist options
  • Save schotime/1d530095078659715fec7bd574acb6e5 to your computer and use it in GitHub Desktop.
Save schotime/1d530095078659715fec7bd574acb6e5 to your computer and use it in GitHub Desktop.
interface A<T> {
something: T
}
function call(arg: (input: A<void>) => void): () => void;
function call<T>(arg: (input: A<T>) => T): (input: T) => void {
return {} as any;
}
interface Input {
title: string
}
call<Input>(x => x.something)({ title: "wow" }); //fails
call(x => x.something)(); //works
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment