You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Java, the interfaces in the collections library allow that implementors only implement the read-only part of the interface throwing UnsupportedOperationException when calling the mutating part.
The Dart interfaces don't explicitly say this. I believe they should, as it allows implementing immutable collection types that implement the Dart collections interfaces.
/**
* Sets the entry at the given [index] in the list to [value].
* Throws an [IndexOutOfRangeException] if [index] is out of bounds.
*/
void operator []=(int index, E value);
//...
}
/**
* Sets the entry at the given [index] in the list to [value].
* Throws an [IndexOutOfRangeException] if [index] is out of bounds.
* Throws an [UnsupportedOperationException] if the list is immutable.
*/
void operator []=(int index, E value);
//...
}
etc.
The text was updated successfully, but these errors were encountered:
Revisions updated by `dart tools/rev_sdk_deps.dart`.
lints (https://github.com/dart-lang/lints/compare/f58fd77..3810f8b):
3810f8b 2023-11-14 Devon Carew add a section on upgrading to the latest lint set to the readme (#171)
mockito (https://github.com/dart-lang/mockito/compare/fcb9779..fb8a2b5):
fb8a2b5 2023-11-16 Kevin Moore No public description
2f41028 2023-11-16 Copybara-Service Merge pull request #719 from dart-lang:latest_lints
8b5036b 2023-11-16 Kevin Moore release later
ecc62f6 2023-11-16 Kevin Moore Update to the latest lints, require Dart 3.1, prepare release
dc3eb65 2023-11-15 Ilya Yanok Generate valid functions with optional non-nullable arguments
sse (https://github.com/dart-lang/sse/compare/8ddb95f..0f6ca11):
0f6ca11 2023-11-15 Kevin Moore Require Dart 3.2, use pkg:web (#92)
tools (https://github.com/dart-lang/tools/compare/2e36b8d..4649307):
4649307 2023-11-15 Elias Yishak Add terminal info to flutter command event (#204)
4e75286 2023-11-13 Devon Carew remove duplicate settings from analysis_options files (#201)
Change-Id: Ie0d8c1897e22ca04563bdc0320cf7485f6e63f7a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336825
Auto-Submit: Devon Carew <devoncarew@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This issue was originally filed by karl.k...@gmail.com
In Java, the interfaces in the collections library allow that implementors only implement the read-only part of the interface throwing UnsupportedOperationException when calling the mutating part.
The Dart interfaces don't explicitly say this. I believe they should, as it allows implementing immutable collection types that implement the Dart collections interfaces.
For example, one might change
interface List<E> extends Collection<E> factory ListFactory {
//...
/**
* Sets the entry at the given [index] in the list to [value].
* Throws an [IndexOutOfRangeException] if [index] is out of bounds.
*/
void operator []=(int index, E value);
//...
}
to
interface List<E> extends Collection<E> factory ListFactory {
//...
/**
* Sets the entry at the given [index] in the list to [value].
* Throws an [IndexOutOfRangeException] if [index] is out of bounds.
* Throws an [UnsupportedOperationException] if the list is immutable.
*/
void operator []=(int index, E value);
//...
}
etc.
The text was updated successfully, but these errors were encountered: