Chromium Code Reviews| 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 446f29cf444fafde70d4871ef7a062b5dccb975f..4e250d8c1252f0ebb537fc5429faa595c2120b73 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 |
| @@ -58,8 +58,9 @@ Future<Null> _runFrontEndInferenceTests() async { |
| try { |
| String code = file.readAsStringSync(); |
| await test.runTest(file.path, code); |
| - } catch (_) { |
| + } catch (_, st) { |
| print(_); |
| + print(st); |
| } finally { |
| await test.tearDown(); |
| } |
| @@ -68,6 +69,10 @@ Future<Null> _runFrontEndInferenceTests() async { |
| class _FrontEndInferenceTest extends BaseAnalysisDriverTest { |
| Future<Null> runTest(String path, String code) async { |
| +// if (!path |
|
Paul Berry
2017/04/27 21:19:29
Was this left in by accident?
|
| +// .endsWith('downwards_inference_on_generic_function_expressions.dart')) { |
| +// return; |
| +// } |
| Uri uri = provider.pathContext.toUri(path); |
| List<int> lineStarts = new LineInfo.fromContent(code).lineStarts; |
| @@ -107,6 +112,11 @@ class _InstrumentationValueForType extends fasta.InstrumentationValue { |
| void _appendElementName(StringBuffer buffer, Element element) { |
| String name = element.name; |
| + if (element.library == null) { |
| + // TODO(scheglov) This is wrong - every element must be in a library. |
| + buffer.write('<unknown>::$name'); |
| + return; |
| + } |
| String libraryName = element.library.name; |
| if (libraryName == '') { |
| throw new StateError('The element $name must be in a named library.'); |
| @@ -142,7 +152,7 @@ class _InstrumentationValueForType extends fasta.InstrumentationValue { |
| StringBuffer buffer, List<ParameterElement> parameters) { |
| _appendList<ParameterElement>(buffer, '(', ')', parameters, ', ', |
| (parameter) { |
| - _appendType(buffer, type); |
| + _appendType(buffer, parameter.type); |
| buffer.write(' '); |
| buffer.write(parameter.name); |
| }, includeEmpty: true); |
| @@ -223,6 +233,26 @@ class _InstrumentationVisitor extends RecursiveAstVisitor<Null> { |
| } |
| } |
| + visitListLiteral(ListLiteral node) { |
| + super.visitListLiteral(node); |
| + if (node.typeArguments == null) { |
| + DartType type = node.staticType; |
| + if (type is InterfaceType) { |
| + _recordTypeArguments(node.offset, type.typeArguments); |
| + } |
| + } |
| + } |
| + |
| + visitMapLiteral(MapLiteral node) { |
| + super.visitMapLiteral(node); |
| + if (node.typeArguments == null) { |
| + DartType type = node.staticType; |
| + if (type is InterfaceType) { |
| + _recordTypeArguments(node.offset, type.typeArguments); |
| + } |
| + } |
| + } |
| + |
| visitSimpleIdentifier(SimpleIdentifier node) { |
| super.visitSimpleIdentifier(node); |
| Element element = node.staticElement; |