Skip to content

Instantly share code, notes, and snippets.

@hatashiro
Created August 1, 2017 17:01
Show Gist options
  • Save hatashiro/2e12fbbd80b840716ea3a1450c967bfe to your computer and use it in GitHub Desktop.
Save hatashiro/2e12fbbd80b840716ea3a1450c967bfe to your computer and use it in GitHub Desktop.
nazo.ts
class A { }
class B extends A { }
class C<T> { }
function test<T extends A>(t: () => T): (ctx: C<T>) => void {
return (ctx: C<T>) => {
};
}
const a = new A();
const b = new B();
test(() => a);
test(() => b);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment