Don't drop type argument on method calls with closure arguments. (#583)

* Don't drop type argument on method calls with closure arguments.

Fix #582.

* Revert testing code.
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8795385..ec5fdd7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,7 @@
+# 0.2.16
+
+* Don't discard type arguments on method calls with closure arguments (#582).
+
 # 0.2.15
 
 * Support `covariant` modifier on methods.
diff --git a/bin/format.dart b/bin/format.dart
index b43bf5d..e1eabbc 100644
--- a/bin/format.dart
+++ b/bin/format.dart
@@ -14,7 +14,7 @@
 import 'package:dart_style/src/source_code.dart';
 
 // Note: The following line of code is modified by tool/grind.dart.
-const version = "0.2.15";
+const version = "0.2.16";
 
 void main(List<String> args) {
   var parser = new ArgParser(allowTrailingOptions: true);
diff --git a/lib/src/call_chain_visitor.dart b/lib/src/call_chain_visitor.dart
index e1fec05..9c40dca 100644
--- a/lib/src/call_chain_visitor.dart
+++ b/lib/src/call_chain_visitor.dart
@@ -410,6 +410,7 @@
   void _writeBlockCall(MethodInvocation invocation) {
     _visitor.token(invocation.operator);
     _visitor.token(invocation.methodName.token);
+    _visitor.visit(invocation.typeArguments);
     _visitor.visit(invocation.argumentList);
   }
 
diff --git a/pubspec.lock b/pubspec.lock
index 2880aa1..d37ee68 100644
--- a/pubspec.lock
+++ b/pubspec.lock
@@ -6,7 +6,7 @@
       name: analyzer
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "0.29.5"
+    version: "0.29.6"
   ansicolor:
     description:
       name: ansicolor
@@ -24,7 +24,7 @@
       name: async
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "1.11.3"
+    version: "1.12.0"
   barback:
     description:
       name: barback
@@ -49,6 +49,12 @@
       url: "https://pub.dartlang.org"
     source: hosted
     version: "1.1.1"
+  cli_util:
+    description:
+      name: cli_util
+      url: "https://pub.dartlang.org"
+    source: hosted
+    version: "0.0.1+2"
   collection:
     description:
       name: collection
@@ -72,7 +78,7 @@
       name: csslib
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "0.13.2+2"
+    version: "0.13.3+1"
   glob:
     description:
       name: glob
@@ -252,7 +258,7 @@
       name: stream_channel
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "1.6.0"
+    version: "1.6.1"
   string_scanner:
     description:
       name: string_scanner
@@ -301,6 +307,18 @@
       url: "https://pub.dartlang.org"
     source: hosted
     version: "1.0.4"
+  when:
+    description:
+      name: when
+      url: "https://pub.dartlang.org"
+    source: hosted
+    version: "0.2.0"
+  which:
+    description:
+      name: which
+      url: "https://pub.dartlang.org"
+    source: hosted
+    version: "0.1.3"
   yaml:
     description:
       name: yaml
diff --git a/pubspec.yaml b/pubspec.yaml
index ad7f415..20c7310 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,6 +1,6 @@
 name: dart_style
 # Note: See tool/grind.dart for how to bump the version.
-version: 0.2.15
+version: 0.2.16
 author: Dart Team <misc@dartlang.org>
 description: Opinionated, automatic Dart source code formatter.
 homepage: https://github.com/dart-lang/dart_style
diff --git a/test/regression/0500/0582.unit b/test/regression/0500/0582.unit
new file mode 100644
index 0000000..9fade0e
--- /dev/null
+++ b/test/regression/0500/0582.unit
@@ -0,0 +1,16 @@
+>>>
+void fn() {
+  List<String> a;
+  // NOTICE THE TYPE PARAMETER
+  a.fold<int>(0, (memo, s) {
+    return max(memo, s.length);
+  });
+}
+<<<
+void fn() {
+  List<String> a;
+  // NOTICE THE TYPE PARAMETER
+  a.fold<int>(0, (memo, s) {
+    return max(memo, s.length);
+  });
+}
\ No newline at end of file