Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@guid-empty
Created February 25, 2021 15:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save guid-empty/7c76b0f7a6d9b04ed4b75cfcd8e76528 to your computer and use it in GitHub Desktop.
Save guid-empty/7c76b0f7a6d9b04ed4b75cfcd8e76528 to your computer and use it in GitHub Desktop.
Dart.Language.Generics & constraints
void main() {}
class OptimizedCollection<T> {
void add(T item) {
item.someUsefulAction();
}
void remove(T item) {
}
}
abstract class Item {
void someUsefulAction();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment