From 9c6e96a3e82faf3459edce2a94b1750268336872 Mon Sep 17 00:00:00 2001 From: Hixie Date: Thu, 12 Nov 2015 12:39:02 -0800 Subject: [PATCH] Remove constructor tear-offs Some of our workflows have no way to silence analyzer warnings, and the analyzer doesn't yet support constructor tear-offs, so pretend that we can't use them for now. --- packages/flutter_tools/lib/src/device.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/flutter_tools/lib/src/device.dart b/packages/flutter_tools/lib/src/device.dart index 47831e83f1c50..69b24bca83b52 100644 --- a/packages/flutter_tools/lib/src/device.dart +++ b/packages/flutter_tools/lib/src/device.dart @@ -79,7 +79,7 @@ class IOSDevice extends Device { String get name => _name; factory IOSDevice({String id, String name}) { - IOSDevice device = Device._unique(id ?? defaultDeviceID, new IOSDevice#_); // analyzer doesn't like constructor tear-offs + IOSDevice device = Device._unique(id ?? defaultDeviceID, (String id) => new IOSDevice._(id)); device._name = name; return device; } @@ -272,7 +272,7 @@ class IOSSimulator extends Device { String get name => _name; factory IOSSimulator({String id, String name, String iOSSimulatorPath}) { - IOSSimulator device = Device._unique(id ?? defaultDeviceID, new IOSSimulator#_); // analyzer doesn't like constructor tear-offs + IOSSimulator device = Device._unique(id ?? defaultDeviceID, (String id) => new IOSSimulator._(id)); device._name = name; if (iOSSimulatorPath == null) { iOSSimulatorPath = path.join('/Applications', 'iOS Simulator.app', @@ -493,7 +493,7 @@ class AndroidDevice extends Device { String productID: null, String modelID: null, String deviceCodeName: null}) { - AndroidDevice device = Device._unique(id ?? defaultDeviceID, new AndroidDevice#_); // analyzer doesn't like constructor tear-offs + AndroidDevice device = Device._unique(id ?? defaultDeviceID, (String id) => new AndroidDevice._(id)); device.productID = productID; device.modelID = modelID; device.deviceCodeName = deviceCodeName;