Index: pkg/analyzer/test/src/task/strong/front_end_inference_test.dart |
diff --git a/pkg/analyzer/test/src/task/strong/front_end_inference_test.dart b/pkg/analyzer/test/src/task/strong/front_end_inference_test.dart |
index 4eb4a57b37e07f5b3202d0b90604e48025d6a1e3..ffc750075edb4b27cc5d63473ff001cf303a2aef 100644 |
--- a/pkg/analyzer/test/src/task/strong/front_end_inference_test.dart |
+++ b/pkg/analyzer/test/src/task/strong/front_end_inference_test.dart |
@@ -369,6 +369,30 @@ class _InstrumentationVisitor extends RecursiveAstVisitor<Null> { |
} |
} |
+ @override |
+ visitFunctionDeclaration(FunctionDeclaration node) { |
+ super.visitFunctionDeclaration(node); |
+ if (node.element is LocalElement && |
+ node.element.enclosingElement is! CompilationUnitElement) { |
+ if (node.returnType == null) { |
+ _instrumentation.record( |
+ uri, |
+ node.name.offset, |
+ 'returnType', |
+ new _InstrumentationValueForType( |
+ node.element.returnType, elementNamer)); |
+ } |
+ var parameters = node.functionExpression.parameters; |
+ for (var parameter in parameters.parameters) { |
+ // Note: it's tempting to check `parameter.type == null`, but that |
+ // doesn't work because of function-typed formal parameter syntax. |
+ if (parameter.element.hasImplicitType) { |
+ _recordType(parameter.identifier.offset, parameter.element.type); |
+ } |
+ } |
+ } |
+ } |
+ |
visitFunctionExpression(FunctionExpression node) { |
super.visitFunctionExpression(node); |
if (node.parent is! FunctionDeclaration) { |