File tree 1 file changed +2
-19
lines changed
pkg/analysis_server/lib/src/services/correction/dart 1 file changed +2
-19
lines changed Original file line number Diff line number Diff line change @@ -188,25 +188,8 @@ class AddDiagnosticPropertyReference extends CorrectionProducer {
188
188
}
189
189
190
190
bool _isIterable (DartType type) {
191
- if (type is ! InterfaceType ) {
192
- return false ;
193
- }
194
-
195
- ClassElement element = type.element;
196
-
197
- bool isExactIterable (ClassElement element) {
198
- return element? .name == 'Iterable' && element.library.isDartCore;
199
- }
200
-
201
- if (isExactIterable (element)) {
202
- return true ;
203
- }
204
- for (var type in element.allSupertypes) {
205
- if (isExactIterable (type.element)) {
206
- return true ;
207
- }
208
- }
209
- return false ;
191
+ return type is InterfaceType &&
192
+ type.asInstanceOf (typeProvider.iterableElement) != null ;
210
193
}
211
194
212
195
/// Return an instance of this class. Used as a tear-off in `FixProcessor` .
You can’t perform that action at this time.
0 commit comments