Skip to content

Instantly share code, notes, and snippets.

@manuel
Created May 15, 2010 09:30
Show Gist options
  • Save manuel/402114 to your computer and use it in GitHub Desktop.
Save manuel/402114 to your computer and use it in GitHub Desktop.
// mutually recursive listener and broadcaster types with
// f-bounded polymorphism
class ListenerType<L extends ListenerType<L, B>, B extends BroadcasterType<L, B>> {
}
class BroadcasterType<L extends ListenerType<L, B>, B extends BroadcasterType<L, B>> {
}
class Listener extends ListenerType<Listener, Broadcaster> {
}
class Broadcaster extends BroadcasterType<Listener, Broadcaster> {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment