Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Example
import 'dart:html';
void main() {
// far far away in code
final cat = new Cat();
// in this function
final list = [cat];
// type error
final newList = filter(list)
..add(new Animal())
..add(new BlackCat());
print(list);
}
List<Animal> filter(List<Animal> input){ return input; }
class Animal {}
class Cat implements Animal {}
class BlackCat implements Cat {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment