Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(496)

Side by Side Diff: lib/src/testing.dart

Issue 1010893004: Allow S->T <: dynamic->T (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Rebase and address comments Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « lib/src/codegen/js_codegen.dart ('k') | test/checker/checker_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library dev_compiler.src.testing; 5 library dev_compiler.src.testing;
6 6
7 import 'package:analyzer/src/generated/ast.dart'; 7 import 'package:analyzer/src/generated/ast.dart';
8 import 'package:analyzer/src/generated/element.dart'; 8 import 'package:analyzer/src/generated/element.dart';
9 import 'package:analyzer/src/generated/engine.dart' show TimestampedData; 9 import 'package:analyzer/src/generated/engine.dart' show TimestampedData;
10 import 'package:analyzer/src/generated/source.dart'; 10 import 'package:analyzer/src/generated/source.dart';
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 Uri _current; 142 Uri _current;
143 143
144 void enterLibrary(Uri uri) { 144 void enterLibrary(Uri uri) {
145 super.enterLibrary(uri); 145 super.enterLibrary(uri);
146 infoMap[uri] = {}; 146 infoMap[uri] = {};
147 _current = uri; 147 _current = uri;
148 } 148 }
149 149
150 void log(Message info) { 150 void log(Message info) {
151 super.log(info); 151 super.log(info);
152 if (info is! StaticInfo) return; 152 if (info is StaticInfo) {
153 infoMap[_current].putIfAbsent(info.node, () => []).add(info); 153 infoMap[_current].putIfAbsent(info.node, () => []).add(info);
154 }
154 } 155 }
155 } 156 }
156 157
157 /// Create an error explanation for errors that were not expected, but that the 158 /// Create an error explanation for errors that were not expected, but that the
158 /// checker produced. 159 /// checker produced.
159 String _unexpectedErrors(AstNode node, List errors) { 160 String _unexpectedErrors(AstNode node, List errors) {
160 final span = _spanFor(node); 161 final span = _spanFor(node);
161 return errors.map((e) { 162 return errors.map((e) {
162 var level = e.level.name.toLowerCase(); 163 var level = e.level.name.toLowerCase();
163 return '$level: ${span.message(e.message, color: colorOf(level))}'; 164 return '$level: ${span.message(e.message, color: colorOf(level))}';
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 336
336 SourceSpan spanFor(AstNode node) { 337 SourceSpan spanFor(AstNode node) {
337 final begin = node is AnnotatedNode 338 final begin = node is AnnotatedNode
338 ? node.firstTokenAfterCommentAndMetadata.offset 339 ? node.firstTokenAfterCommentAndMetadata.offset
339 : node.offset; 340 : node.offset;
340 return _file.span(begin, node.end); 341 return _file.span(begin, node.end);
341 } 342 }
342 343
343 String toString() => '[$runtimeType: $uri]'; 344 String toString() => '[$runtimeType: $uri]';
344 } 345 }
OLDNEW
« no previous file with comments | « lib/src/codegen/js_codegen.dart ('k') | test/checker/checker_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698