I have an issue related to the new instantiate to bound rule in Dart 1.22.0. I have a BaseModel
class that takes a parameterized type called ParentType
that itself extends BaseModel
.
Not all BaseModels have a specific ParentType, and if I instantiate BaseModel as the ParentType, then I get infinite rule breaking.
Here's an example:
abstract class BaseModel<ParentType extends BaseModel> {
ParentType parentModel
}
class ParentModel extends BaseModel<BaseModel<...>> {}
class ChildModel extends BaseModel<ParentModel> {}
I’m going to be ignoring the rule for now as this issue hasn't seemed to have any impact on development.