Skip to content

Commit 58e0027

Browse files
committed
fix showing duplicate implementors
1 parent bf92a7e commit 58e0027

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

lib/src/model.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ void _addToImplementors(Class c) {
2525
_implementors.putIfAbsent(key, () => []);
2626
List list = _implementors[key];
2727

28-
if (!list.contains(implClass)) {
28+
if (!list.any((l) => l.element == c.element)) {
2929
list.add(implClass);
3030
}
3131
}

test/model_test.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,10 @@ void main() {
286286
expect(Apple.mixins, hasLength(0));
287287
});
288288

289+
test('implementors', () {
290+
expect(Apple.implementors, hasLength(1));
291+
});
292+
289293
test('mixins not private', () {
290294
expect(F.mixins, hasLength(0));
291295
});

test_package/lib/fake.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ library fake;
4343
import 'dart:async';
4444

4545
import 'example.dart';
46+
export 'example.dart' show B;
4647

4748
/// Useful for annotations.
4849
class Annotation {

0 commit comments

Comments
 (0)