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

Side by Side Diff: lib/src/wrappers.dart

Issue 1848563002: Don't mix commented and uncommented generics. (Closed) Base URL: git@github.com:dart-lang/collection@master
Patch Set: Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « CHANGELOG.md ('k') | pubspec.yaml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import "dart:collection"; 5 import "dart:collection";
6 import "dart:math" as math; 6 import "dart:math" as math;
7 7
8 import "typed_wrappers.dart"; 8 import "typed_wrappers.dart";
9 import "unmodifiable_wrappers.dart"; 9 import "unmodifiable_wrappers.dart";
10 10
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 /// This soundly converts a [Map] without generic types to a `Map<K, V>` by 352 /// This soundly converts a [Map] without generic types to a `Map<K, V>` by
353 /// asserting that its keys are instances of `E` and its values are instances 353 /// asserting that its keys are instances of `E` and its values are instances
354 /// of `V` whenever they're accessed. If they're not, it throws a [CastError]. 354 /// of `V` whenever they're accessed. If they're not, it throws a [CastError].
355 /// Note that even if an operation throws a [CastError], it may still mutate 355 /// Note that even if an operation throws a [CastError], it may still mutate
356 /// the underlying collection. 356 /// the underlying collection.
357 /// 357 ///
358 /// This forwards all operations to [base], so any changes in [base] will be 358 /// This forwards all operations to [base], so any changes in [base] will be
359 /// reflected in [this]. If [base] is already a `Map<K, V>`, it's returned 359 /// reflected in [this]. If [base] is already a `Map<K, V>`, it's returned
360 /// unmodified. 360 /// unmodified.
361 static Map/*<K, V>*/ typed/*<K, V>*/(Map base) => 361 static Map/*<K, V>*/ typed/*<K, V>*/(Map base) =>
362 base is Map<K, V> ? base : new TypeSafeMap<K, V>(base); 362 base is Map/*<K, V>*/ ? base : new TypeSafeMap/*<K, V>*/(base);
363 363
364 V operator [](Object key) => _base[key]; 364 V operator [](Object key) => _base[key];
365 365
366 void operator []=(K key, V value) { 366 void operator []=(K key, V value) {
367 _base[key] = value; 367 _base[key] = value;
368 } 368 }
369 369
370 void addAll(Map<K, V> other) { 370 void addAll(Map<K, V> other) {
371 _base.addAll(other); 371 _base.addAll(other);
372 } 372 }
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 597
598 /// Returns a new set which contains all the elements of [this] and [other]. 598 /// Returns a new set which contains all the elements of [this] and [other].
599 /// 599 ///
600 /// That is, the returned set contains all the elements of this [Set] and all 600 /// That is, the returned set contains all the elements of this [Set] and all
601 /// the elements of [other]. 601 /// the elements of [other].
602 /// 602 ///
603 /// Note that the returned set will use the default equality operation, which 603 /// Note that the returned set will use the default equality operation, which
604 /// may be different than the equality operation [this] uses. 604 /// may be different than the equality operation [this] uses.
605 Set<V> union(Set<V> other) => toSet()..addAll(other); 605 Set<V> union(Set<V> other) => toSet()..addAll(other);
606 } 606 }
OLDNEW
« no previous file with comments | « CHANGELOG.md ('k') | pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698