@@ -60,9 +60,7 @@ class ObservableList<E> extends ListBase<E> with Observable {
6060
6161 ObservableList ._spy (List <E > other) : _list = other;
6262
63- /// Returns a view of this list as a list of [T] instances, if necessary.
64- ///
65- /// If this list is already a `ObservableList<T>` , it is returned unchanged.
63+ /// Returns a view of this list as a list of [T] instances.
6664 ///
6765 /// If this list contains only instances of [T] , all read operations
6866 /// will work correctly. If any operation tries to access an element
@@ -73,12 +71,7 @@ class ObservableList<E> extends ListBase<E> with Observable {
7371 /// and they must be instances of [E] as well to be accepted by
7472 /// this list as well.
7573 @override
76- ObservableList <T > cast <T >() {
77- if (this is ObservableList <T >) {
78- return this as ObservableList <T >;
79- }
80- return retype <T >();
81- }
74+ ObservableList <T > cast <T >() => ObservableList .castFrom <E , T >(this );
8275
8376 /// Returns a view of this list as a list of [T] instances.
8477 ///
@@ -91,7 +84,8 @@ class ObservableList<E> extends ListBase<E> with Observable {
9184 /// and they must be instances of [E] as well to be accepted by
9285 /// this list as well.
9386 @override
94- ObservableList <T > retype <T >() => ObservableList .castFrom <E , T >(this );
87+ // ignore: override_on_non_overriding_method
88+ ObservableList <T > retype <T >() => cast <T >();
9589
9690 /// The stream of summarized list changes, delivered asynchronously.
9791 ///
0 commit comments