Dart 聚合物:X 型不是 Y 型的子类型

Dart Polymer : Type X is not a subtype of type Y

我在 PyCharm 上使用 Dart 和 Polymer 开发我的应用程序。我目前有一个错误:

Exception: type 'ObservableList<DrugFilterItem>' is not a subtype of type 'ObservableList<DrugCompareItem>' of '__$orderFilterList@51385934'
ObservableList is from package:observe/src/observable_list.dart
DrugFilterItem is from package:synmed/drug_elements/views/drug_filter_menu.dart
ObservableList is from package:observe/src/observable_list.dart
DrugCompareItem is from package:synmed/drug_elements/views/drug_search_toolbar.dart

DrugFilterItem 和 DrugCompareItem 都是自定义的 类,DrugCompareItem 扩展了 DrugFilterItem,错误设计的行是:

ObservableList<DrugCompareItem> orderFilterList = new ObservableList<DrugFilterItem>();

今天突然出现这个问题:我安装了Pycharm2016.3 并尝试编码,但是我的package shadow 出错,我解决了。因为,我有这个错误,我认为这是包的问题,​​因为代码从之前到之后都没有改变。

我现在发现的实际上什么都没有,我读了很多关于这种错误的 post,经常出现的主题之一是导入,但我没有发现任何问题.我正在使用 Dart 1.20.1 和

polymer: "<=0.16.4+1"
core_elements: "<=0.7.1+3"
paper_elements: "<=0.7.1"

有人知道我的线索吗?谢谢!

听起来像https://github.com/dart-lang/sdk/issues/14972#issuecomment-108402835

I believe this is working as intended. A List is not assignable to a List, even if it only contains Apples.

There are several ways to work around this:

iterable.map((x) => x) (removing the generic type),
new List<MethodMirror>.from(iterable)
new MyIterableWrapper<MethodMirror>(iterable) (where the iterable-wrapper that would need to be written).