Chromium Code Reviews| Index: pkg/collection/lib/src/unmodifiable_wrappers.dart |
| diff --git a/pkg/collection/lib/src/unmodifiable_wrappers.dart b/pkg/collection/lib/src/unmodifiable_wrappers.dart |
| index 022bbfe17427fb68e25e2cc57f7c0302df30c5ce..a60ca3dd5b2a4b675598467dab80a71099aa098a 100644 |
| --- a/pkg/collection/lib/src/unmodifiable_wrappers.dart |
| +++ b/pkg/collection/lib/src/unmodifiable_wrappers.dart |
| @@ -53,6 +53,7 @@ abstract class NonGrowableListMixin<E> implements List<E> { |
| */ |
| bool add(E value) { |
| _throw(); |
| + throw 'unreachable'; |
|
Lasse Reichstein Nielsen
2014/05/29 21:55:06
Maybe change _throw to return dynamic and write th
nweiz
2014/05/30 00:49:41
Done.
|
| } |
| /** |
| @@ -77,19 +78,28 @@ abstract class NonGrowableListMixin<E> implements List<E> { |
| * Throws an [UnsupportedError]; |
| * operations that change the length of the list are disallowed. |
| */ |
| - bool remove(Object value) { _throw(); } |
| + bool remove(Object value) { |
| + _throw(); |
| + throw 'unreachable'; |
| + } |
| /** |
| * Throws an [UnsupportedError]; |
| * operations that change the length of the list are disallowed. |
| */ |
| - E removeAt(int index) { _throw(); } |
| + E removeAt(int index) { |
| + _throw(); |
| + throw 'unreachable'; |
| + } |
| /** |
| * Throws an [UnsupportedError]; |
| * operations that change the length of the list are disallowed. |
| */ |
| - E removeLast() { _throw(); } |
| + E removeLast() { |
| + _throw(); |
| + throw 'unreachable'; |
| + } |
| /** |
| * Throws an [UnsupportedError]; |
| @@ -151,6 +161,7 @@ abstract class UnmodifiableSetMixin<E> implements Set<E> { |
| */ |
| bool add(E value) { |
| _throw(); |
| + throw 'unreachable'; |
| } |
| /** |
| @@ -163,7 +174,10 @@ abstract class UnmodifiableSetMixin<E> implements Set<E> { |
| * Throws an [UnsupportedError]; |
| * operations that change the set are disallowed. |
| */ |
| - bool remove(Object value) { _throw(); } |
| + bool remove(Object value) { |
| + _throw(); |
| + throw 'unreachable'; |
| + } |
| /** |
| * Throws an [UnsupportedError]; |
| @@ -229,7 +243,10 @@ abstract class UnmodifiableMapMixin<K, V> implements Map<K, V> { |
| * Throws an [UnsupportedError]; |
| * operations that change the map are disallowed. |
| */ |
| - V putIfAbsent(K key, V ifAbsent()) { _throw(); } |
| + V putIfAbsent(K key, V ifAbsent()) { |
| + _throw(); |
| + throw 'unreachable'; |
| + } |
| /** |
| * Throws an [UnsupportedError]; |
| @@ -241,7 +258,10 @@ abstract class UnmodifiableMapMixin<K, V> implements Map<K, V> { |
| * Throws an [UnsupportedError]; |
| * operations that change the map are disallowed. |
| */ |
| - V remove(K key) { _throw(); } |
| + V remove(K key) { |
| + _throw(); |
| + throw 'unreachable'; |
| + } |
| /** |
| * Throws an [UnsupportedError]; |