Skip to content

Instantly share code, notes, and snippets.

@ORESoftware ORESoftware/generics.ts
Last active Nov 25, 2017

Embed
What would you like to do?
Need to make this compile
class A {
foo(): A {
return this;
}
}
class B extends A {
bar(): B {
return this;
}
}
new B().foo().bar(); // does not compile
@ORESoftware

This comment has been minimized.

Copy link
Owner Author

commented Nov 25, 2017

this will not compile, but will work at runtime

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.