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

Side by Side Diff: tests/compiler/dart2js/related_types.dart

Issue 1363993004: Report info messages together with their error, warning, or hint. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comment. Created 5 years, 3 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 | « tests/compiler/dart2js/parser_test.dart ('k') | tests/compiler/dart2js/unparser2_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 related_types; 5 library related_types;
6 6
7 import 'package:compiler/src/commandline_options.dart'; 7 import 'package:compiler/src/commandline_options.dart';
8 import 'package:compiler/src/compiler.dart'; 8 import 'package:compiler/src/compiler.dart';
9 import 'package:compiler/src/core_types.dart'; 9 import 'package:compiler/src/core_types.dart';
10 import 'package:compiler/src/dart_types.dart'; 10 import 'package:compiler/src/dart_types.dart';
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 if (leftClass != null && rightClass != null) { 90 if (leftClass != null && rightClass != null) {
91 return !world.haveAnyCommonSubtypes(leftClass, rightClass); 91 return !world.haveAnyCommonSubtypes(leftClass, rightClass);
92 } 92 }
93 return false; 93 return false;
94 } 94 }
95 95
96 /// Checks that there exists a common subtype of [left] and [right] or report 96 /// Checks that there exists a common subtype of [left] and [right] or report
97 /// a hint otherwise. 97 /// a hint otherwise.
98 void checkRelated(Node node, DartType left, DartType right) { 98 void checkRelated(Node node, DartType left, DartType right) {
99 if (hasEmptyIntersection(left, right)) { 99 if (hasEmptyIntersection(left, right)) {
100 compiler.reportHint( 100 compiler.reportHint(compiler.createMessage(
101 node, MessageKind.NO_COMMON_SUBTYPES, {'left': left, 'right': right}); 101 node,
102 MessageKind.NO_COMMON_SUBTYPES,
103 {'left': left, 'right': right}));
102 } 104 }
103 } 105 }
104 106
105 /// Check weakly typed collection methods, like `Map.containsKey`, 107 /// Check weakly typed collection methods, like `Map.containsKey`,
106 /// `Map.containsValue` and `Iterable.contains`. 108 /// `Map.containsValue` and `Iterable.contains`.
107 void checkDynamicInvoke( 109 void checkDynamicInvoke(
108 Node node, 110 Node node,
109 DartType receiverType, 111 DartType receiverType,
110 List<DartType> argumentTypes, 112 List<DartType> argumentTypes,
111 Selector selector) { 113 Selector selector) {
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 ClassElement findClass(DartType type) => type.accept(this, null); 424 ClassElement findClass(DartType type) => type.accept(this, null);
423 425
424 @override 426 @override
425 ClassElement visitType(DartType type, _) => null; 427 ClassElement visitType(DartType type, _) => null;
426 428
427 @override 429 @override
428 ClassElement visitInterfaceType(InterfaceType type, _) { 430 ClassElement visitInterfaceType(InterfaceType type, _) {
429 return type.element; 431 return type.element;
430 } 432 }
431 } 433 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/parser_test.dart ('k') | tests/compiler/dart2js/unparser2_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698