Created
November 8, 2019 06:27
-
-
Save bsutton/acbda315533917a1eb76dcfd02947d5e to your computer and use it in GitHub Desktop.
Dart: Overloading generic method
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyRepo | |
{ | |
} | |
class RealRepo<E extends Entity> | |
{ | |
Repository<E> repo; | |
} | |
abstract class TypedEvent<T> | |
{ | |
void run<R extends MyRepo>(R repo); | |
} | |
class DNDEvent extends TypedEvent<bool> | |
{ | |
@override | |
void run(RealRepo<DND> repo){ | |
} | |
} | |
} | |
class Repository<E extends Entity> | |
{} | |
class Entity | |
{} | |
class DND extends Entity | |
{} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment