Closed as not planned
Description
How to use typedef with generics ?
How to use typedef inside a class ?
I have the following class.
class Bar<T> {
void bar() {
print(T);
}
}
class Foo<T> {
Bar<T> merge(Bar<T> a, Bar<T> b, Bar<T> c) {
a.bar();
b.bar();
return c;
}
}
To avoid repeating Bar<T>
I want to use typedef
class Foo<T> {
typedef Baz = Bar<T>;
Baz merge(Baz a, Baz b, Baz c) {
a.bar();
b.bar();
return c;
}
}
But this is obviously not working with the current Dart. Is it supported ? I know I create an alias of the Bar to a shorter string but this does not remove the generic, the problem is in reality, the generic has several nested class like Foo<Bar<Baz<Foz<Boz<T>>>>