Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(504)

Unified Diff: pkg/collection/lib/src/unmodifiable_wrappers.dart

Issue 308653004: Fix analyzer hints in pkg/collection. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/collection/CHANGELOG.md ('k') | pkg/collection/pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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];
« no previous file with comments | « pkg/collection/CHANGELOG.md ('k') | pkg/collection/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698