mirror of
https://github.com/dart-lang/sdk
synced 2024-10-06 15:39:54 +00:00
[collection] Update example code in dartdoc
Added 'final' to the example class `EntryItem` that extends `LinkedListEntry` from 'dart:collection'. The code as written now produces the error: ``` The type 'EntryItem' must be 'base', 'final' or 'sealed' because the supertype 'LinkedListEntry' is 'base'. ``` Also applied dartfmt to get new line break locations. Change-Id: I78e76c7d9d4e6cd29c2e229ab1054efad21c6248 CoreLibraryReviewExempt: Comments only Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/343688 Reviewed-by: Nate Bosch <nbosch@google.com> Commit-Queue: Nicholas Shahan <nshahan@google.com>
This commit is contained in:
parent
c944fc1db1
commit
0c4147675f
|
@ -31,7 +31,7 @@ part of dart.collection;
|
||||||
///
|
///
|
||||||
/// Example:
|
/// Example:
|
||||||
/// ```dart
|
/// ```dart
|
||||||
/// class EntryItem extends LinkedListEntry<EntryItem> {
|
/// final class EntryItem extends LinkedListEntry<EntryItem> {
|
||||||
/// final int id;
|
/// final int id;
|
||||||
/// final String text;
|
/// final String text;
|
||||||
/// EntryItem(this.id, this.text);
|
/// EntryItem(this.id, this.text);
|
||||||
|
@ -42,10 +42,10 @@ part of dart.collection;
|
||||||
/// }
|
/// }
|
||||||
/// }
|
/// }
|
||||||
///
|
///
|
||||||
/// void main(){
|
/// void main() {
|
||||||
/// final linkedList = LinkedList<EntryItem>();
|
/// final linkedList = LinkedList<EntryItem>();
|
||||||
/// linkedList.addAll(
|
/// linkedList
|
||||||
/// [EntryItem(1, 'A'), EntryItem(2, 'B'), EntryItem(3, 'C')]);
|
/// .addAll([EntryItem(1, 'A'), EntryItem(2, 'B'), EntryItem(3, 'C')]);
|
||||||
/// print(linkedList.first); // 1 : A
|
/// print(linkedList.first); // 1 : A
|
||||||
/// print(linkedList.last); // 3 : C
|
/// print(linkedList.last); // 3 : C
|
||||||
///
|
///
|
||||||
|
|
Loading…
Reference in a new issue