Fix fuzzy arrow warnings in analyzer and analysis_server.

There is one warning which I'd like to fix in a separate CL.

The rest is because of package:test predicate().
I think Leaf fixed it in 3625f13698


R=brianwilkerson@google.com

Bug:
Change-Id: I060f7ced55dbcc460185916251c47ebbd5c838d3
Reviewed-on: https://dart-review.googlesource.com/3404
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This commit is contained in:
Konstantin Shcheglov 2017-09-05 16:22:55 -07:00 committed by commit-bot@chromium.org
parent beddf07fdc
commit 455984bbf9
13 changed files with 18 additions and 16 deletions

View file

@ -257,7 +257,7 @@ abstract class CommonInputConverter extends Converter<String, Operation> {
}
if (json is Map) {
Map<String, dynamic> result = new Map<String, dynamic>();
json.forEach((String origKey, value) {
json.forEach((origKey, value) {
result[translateSrcPaths(origKey)] = translateSrcPaths(value);
});
return result;

View file

@ -131,7 +131,7 @@ class ResponseOperation extends Operation {
bool _equal(expectedResult, actualResult) {
if (expectedResult is Map && actualResult is Map) {
if (expectedResult.length == actualResult.length) {
return expectedResult.keys.every((String key) {
return expectedResult.keys.every((key) {
return key ==
'fileStamp' || // fileStamp values will not be the same across runs
_equal(expectedResult[key], actualResult[key]);

View file

@ -89,7 +89,8 @@ SourceFileEdit getChangeFileEdit(SourceChange change, String file) {
* Compare the lists [listA] and [listB], using [itemEqual] to compare
* list elements.
*/
bool listEqual(List listA, List listB, bool itemEqual(a, b)) {
bool listEqual<T1, T2>(
List<T1> listA, List<T2> listB, bool itemEqual(T1 a, T2 b)) {
if (listA == null) {
return listB == null;
}
@ -111,7 +112,7 @@ bool listEqual(List listA, List listB, bool itemEqual(a, b)) {
* Compare the maps [mapA] and [mapB], using [valueEqual] to compare map
* values.
*/
bool mapEqual(Map mapA, Map mapB, bool valueEqual(a, b)) {
bool mapEqual<K, V>(Map<K, V> mapA, Map<K, V> mapB, bool valueEqual(V a, V b)) {
if (mapA == null) {
return mapB == null;
}

View file

@ -916,7 +916,7 @@ abstract class _RecursiveMatcher extends Matcher {
* substructure did not match.
*/
checkSubstructure(item, Matcher matcher, List<MismatchDescriber> mismatches,
Description describeSubstructure(Description)) {
Description describeSubstructure(Description description)) {
Map subState = {};
if (!matcher.matches(item, subState)) {
mismatches.add((Description mismatchDescription) {

View file

@ -121,7 +121,7 @@ class ApiReader {
dom.Element element, List<String> requiredAttributes, String context,
{List<String> optionalAttributes: const []}) {
Set<String> attributesFound = new Set<String>();
element.attributes.forEach((String name, String value) {
element.attributes.forEach((name, value) {
if (!requiredAttributes.contains(name) &&
!optionalAttributes.contains(name)) {
throw new Exception(

View file

@ -74,7 +74,7 @@ class ContextRoot {
* Compare the lists [listA] and [listB], using [itemEqual] to compare
* list elements.
*/
bool _listEqual(List listA, List listB, bool itemEqual(a, b)) {
bool _listEqual<T>(List<T> listA, List<T> listB, bool itemEqual(T a, T b)) {
if (listA == null) {
return listB == null;
}

View file

@ -20,7 +20,7 @@ typedef EvictionHandler<K, V>(K key, V value);
class LRUMap<K, V> {
final LinkedHashMap<K, V> _map = new LinkedHashMap<K, V>();
final int _maxSize;
final EvictionHandler _handler;
final EvictionHandler<K, V> _handler;
LRUMap(this._maxSize, [this._handler]);

View file

@ -89,7 +89,7 @@ class Driver {
* result descriptors.
*/
void findExtensions(AstNode node, TopLevelVariableElement extensionIdVariable,
void callback(descriptorName)) {
void callback(String descriptorName)) {
Set<PropertyAccessorElement> resultDescriptors =
new Set<PropertyAccessorElement>();
node.accept(new ExtensionFinder(

View file

@ -29,7 +29,7 @@ class BatchRunner {
int totalTests = 0;
ErrorSeverity batchResult = ErrorSeverity.NONE;
// Read line from stdin.
Stream cmdLine =
Stream<String> cmdLine =
stdin.transform(UTF8.decoder).transform(new LineSplitter());
cmdLine.listen((String line) async {
// Maybe finish.

View file

@ -38,7 +38,8 @@ class BuiltInServerIsolateChannel extends ServerIsolateChannel {
@override
Future<Isolate> _spawnIsolate() {
return Isolate.spawn(entryPoint, _receivePort.sendPort,
return Isolate.spawn(
(message) => entryPoint(message as SendPort), _receivePort.sendPort,
onError: _errorPort?.sendPort, onExit: _exitPort?.sendPort);
}
}

View file

@ -84,7 +84,7 @@ SourceFileEdit getChangeFileEdit(SourceChange change, String file) {
* Compare the lists [listA] and [listB], using [itemEqual] to compare
* list elements.
*/
bool listEqual(List listA, List listB, bool itemEqual(a, b)) {
bool listEqual<T>(List<T> listA, List<T> listB, bool itemEqual(T a, T b)) {
if (listA == null) {
return listB == null;
}
@ -106,7 +106,7 @@ bool listEqual(List listA, List listB, bool itemEqual(a, b)) {
* Compare the maps [mapA] and [mapB], using [valueEqual] to compare map
* values.
*/
bool mapEqual(Map mapA, Map mapB, bool valueEqual(a, b)) {
bool mapEqual<K, V>(Map<K, V> mapA, Map<K, V> mapB, bool valueEqual(V a, V b)) {
if (mapA == null) {
return mapB == null;
}
@ -316,7 +316,7 @@ abstract class JsonDecoder {
return {};
} else if (json is Map) {
Map<K, V> result = <K, V>{};
json.forEach((String key, value) {
json.forEach((key, value) {
K decodedKey;
if (keyDecoder != null) {
decodedKey = keyDecoder('$jsonPath.key', key);

View file

@ -886,7 +886,7 @@ abstract class _RecursiveMatcher extends Matcher {
* substructure did not match.
*/
checkSubstructure(item, Matcher matcher, List<MismatchDescriber> mismatches,
Description describeSubstructure(Description)) {
Description describeSubstructure(Description description)) {
Map subState = {};
if (!matcher.matches(item, subState)) {
mismatches.add((Description mismatchDescription) {

View file

@ -121,7 +121,7 @@ class ApiReader {
dom.Element element, List<String> requiredAttributes, String context,
{List<String> optionalAttributes: const []}) {
Set<String> attributesFound = new Set<String>();
element.attributes.forEach((String name, String value) {
element.attributes.forEach((name, value) {
if (!requiredAttributes.contains(name) &&
!optionalAttributes.contains(name)) {
throw new Exception(