I use Dart2JS Compiler version 1.0.0_r30798 (STABLE).
Sample code (only for introducing problem):
The real code here (now corrected for dart2js behavior): https://github.com/mezoni/queries/blob/master/lib/src/queries/lookup.dart
This is a part of Queryable collections for Dart language.
class ILookup<TKey, TElement> implements IEnumerable<IGrouping<TKey, TElement>> {
}
class Lookup<TKey, TElement> extends Object with Enumerable implements ILookup<TKey, TElement> {
}
class IEnumerable<T> implements HasIterator<T> {
}
class HasIterator<T> {
}
class IGrouping<TKey, TElement> implements IEnumerable<TKey> {
}
class Enumerable<T> implements IEnumerable<T> {
}
void main() {
var obj = new Lookup();
print(obj);
}
This code generates the following error of Google Dart dart2js Compiler:
Internal Error: Inheritance of the same class with different type arguments is not
supported: Both HasIterator<dynamic> and HasIterator<IGrouping<TKey, TElement>> are
supertypes of Lookup<TKey, TElement>.
class Lookup<TKey, TElement> extends Object with Enumerable implements ILookup<TKey,
TElement> {
^^^^^
Error: Compilation failed.
That is, the dart2js
compiler cannot compile this code.
So, I cannot understand: " Is this bug, feature or limitation?".