Disable the .whereType method until generic methods are turned on.

The whereType method silently does the wrong thing without methods,
so make it throw until we turn them on everywhere.

Change-Id: Id934c8bdb4f682dbc3560d78fbca580e37297e2d
Reviewed-on: https://dart-review.googlesource.com/45744
Reviewed-by: Nate Bosch <nbosch@google.com>
This commit is contained in:
Leaf Petersen 2018-03-08 23:14:22 +00:00
parent 16e8194147
commit 4c881188b2
7 changed files with 55 additions and 9 deletions

View file

@ -1,3 +1,11 @@
### Core library changes
* Temporarily disabled the `whereType` method until generic methods are enabled
on all platforms ([issue 32463]).
[issue 32463]: https://github.com/dart-lang/sdk/issues/32463
## 2.0.0
### Language

View file

@ -601,7 +601,11 @@ class JSArray<E> implements List<E>, JSIndexable<E> {
Iterable<E> followedBy(Iterable<E> other) =>
new FollowedByIterable<E>.firstEfficient(this, other);
Iterable<T> whereType<T>() => new WhereTypeIterable<T>(this);
// TODO(leafp): Restore this functionality once generic methods are enabled
// in the VM and dart2js.
// https://github.com/dart-lang/sdk/issues/32463
Iterable<T> whereType<T>() =>
throw new UnimplementedError("whereType is not yet supported");
List<E> operator +(List<E> other) {
int totalLength = this.length + other.length;

View file

@ -114,7 +114,11 @@ abstract class _IntListMixin implements List<int> {
List<int> _createList(int length);
Iterable<T> whereType<T>() => new WhereTypeIterable<T>(this);
// TODO(leafp): Restore this functionality once generic methods are enabled
// in the VM and dart2js.
// https://github.com/dart-lang/sdk/issues/32463
Iterable<T> whereType<T>() =>
throw new UnimplementedError("whereType is not yet supported");
Iterable<int> followedBy(Iterable<int> other) =>
new FollowedByIterable<int>.firstEfficient(this, other);
@ -473,7 +477,11 @@ abstract class _DoubleListMixin implements List<double> {
List<double> _createList(int length);
Iterable<T> whereType<T>() => new WhereTypeIterable<T>(this);
// TODO(leafp): Restore this functionality once generic methods are enabled
// in the VM and dart2js.
// https://github.com/dart-lang/sdk/issues/32463
Iterable<T> whereType<T>() =>
throw new UnimplementedError("whereType is not yet supported");
Iterable<double> followedBy(Iterable<double> other) =>
new FollowedByIterable<double>.firstEfficient(this, other);
@ -835,7 +843,11 @@ abstract class _Float32x4ListMixin implements List<Float32x4> {
List<Float32x4> _createList(int length);
Iterable<T> whereType<T>() => new WhereTypeIterable<T>(this);
// TODO(leafp): Restore this functionality once generic methods are enabled
// in the VM and dart2js.
// https://github.com/dart-lang/sdk/issues/32463
Iterable<T> whereType<T>() =>
throw new UnimplementedError("whereType is not yet supported");
Iterable<Float32x4> followedBy(Iterable<Float32x4> other) =>
new FollowedByIterable<Float32x4>.firstEfficient(this, other);
@ -1201,7 +1213,11 @@ abstract class _Int32x4ListMixin implements List<Int32x4> {
List<Int32x4> _createList(int length);
Iterable<T> whereType<T>() => new WhereTypeIterable<T>(this);
// TODO(leafp): Restore this functionality once generic methods are enabled
// in the VM and dart2js.
// https://github.com/dart-lang/sdk/issues/32463
Iterable<T> whereType<T>() =>
throw new UnimplementedError("whereType is not yet supported");
Iterable<Int32x4> followedBy(Iterable<Int32x4> other) =>
new FollowedByIterable<Int32x4>.firstEfficient(this, other);
@ -1566,7 +1582,11 @@ abstract class _Float64x2ListMixin implements List<Float64x2> {
List<Float64x2> _createList(int length);
Iterable<T> whereType<T>() => new WhereTypeIterable<T>(this);
// TODO(leafp): Restore this functionality once generic methods are enabled
// in the VM and dart2js.
// https://github.com/dart-lang/sdk/issues/32463
Iterable<T> whereType<T>() =>
throw new UnimplementedError("whereType is not yet supported");
Iterable<Float64x2> followedBy(Iterable<Float64x2> other) =>
new FollowedByIterable<Float64x2>.firstEfficient(this, other);

View file

@ -26,7 +26,11 @@ abstract class IterableMixin<E> implements Iterable<E> {
Iterable<E> where(bool f(E element)) => new WhereIterable<E>(this, f);
Iterable<T> whereType<T>() => new WhereTypeIterable<T>(this);
// TODO(leafp): Restore this functionality once generic methods are enabled
// in the VM and dart2js.
// https://github.com/dart-lang/sdk/issues/32463
Iterable<T> whereType<T>() =>
throw new UnimplementedError("whereType is not yet supported");
Iterable<T> expand<T>(Iterable<T> f(E element)) =>
new ExpandIterable<E, T>(this, f);

View file

@ -191,7 +191,11 @@ abstract class ListMixin<E> implements List<E> {
Iterable<E> where(bool test(E element)) => new WhereIterable<E>(this, test);
Iterable<T> whereType<T>() => new WhereTypeIterable<T>(this);
// TODO(leafp): Restore this functionality once generic methods are enabled
// in the VM and dart2js.
// https://github.com/dart-lang/sdk/issues/32463
Iterable<T> whereType<T>() =>
throw new UnimplementedError("whereType is not yet supported");
Iterable<T> map<T>(T f(E element)) => new MappedListIterable<E, T>(this, f);

View file

@ -61,7 +61,11 @@ abstract class SetMixin<E> implements Set<E> {
Iterable<E> followedBy(Iterable<E> other) =>
new FollowedByIterable<E>.firstEfficient(this, other);
Iterable<T> whereType<T>() => new WhereTypeIterable<T>(this);
// TODO(leafp): Restore this functionality once generic methods are enabled
// in the VM and dart2js.
// https://github.com/dart-lang/sdk/issues/32463
Iterable<T> whereType<T>() =>
throw new UnimplementedError("whereType is not yet supported");
void clear() {
removeAll(toList());

View file

@ -2,6 +2,8 @@
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
iterable_where_type_test: RuntimeError # Disabled. Issue 32463
[ $compiler == dart2analyzer ]
compare_to2_test: CompileTimeError # invalid test
int_parse_radix_bad_handler_test: MissingCompileTimeError