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

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

Issue 1310053005: Make implicit casts hints (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: 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 | « no previous file | 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 /// Defines static information collected by the type checker and used later by 5 /// Defines static information collected by the type checker and used later by
6 /// emitters to generate code. 6 /// emitters to generate code.
7 library dev_compiler.src.info; 7 library dev_compiler.src.info;
8 8
9 import 'package:analyzer/src/generated/ast.dart'; 9 import 'package:analyzer/src/generated/ast.dart';
10 import 'package:analyzer/src/generated/element.dart'; 10 import 'package:analyzer/src/generated/element.dart';
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 325
326 toErrorCode() => new StaticTypeWarningCode(name, message); 326 toErrorCode() => new StaticTypeWarningCode(name, message);
327 } 327 }
328 328
329 // A down cast to a non-ground type. These behave differently from standard 329 // A down cast to a non-ground type. These behave differently from standard
330 // Dart and may be more likely to fail at runtime. 330 // Dart and may be more likely to fail at runtime.
331 class DownCastImplicit extends DownCast { 331 class DownCastImplicit extends DownCast {
332 DownCastImplicit(TypeRules rules, Expression expression, Cast cast) 332 DownCastImplicit(TypeRules rules, Expression expression, Cast cast)
333 : super._internal(rules, expression, cast); 333 : super._internal(rules, expression, cast);
334 334
335 toErrorCode() => new StaticTypeWarningCode(name, message); 335 toErrorCode() => new HintCode(name, message);
336 } 336 }
337 337
338 // An inferred type for the wrapped expression, which may need to be 338 // An inferred type for the wrapped expression, which may need to be
339 // reified into the term 339 // reified into the term
340 abstract class InferredTypeBase extends CoercionInfo { 340 abstract class InferredTypeBase extends CoercionInfo {
341 final DartType _type; 341 final DartType _type;
342 342
343 InferredTypeBase._internal(TypeRules rules, Expression expression, this._type) 343 InferredTypeBase._internal(TypeRules rules, Expression expression, this._type)
344 : super(rules, expression); 344 : super(rules, expression);
345 345
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
573 /// Better to have `super` at the end, as required by the Dart style guide: 573 /// Better to have `super` at the end, as required by the Dart style guide:
574 /// <http://goo.gl/q1T4BB> 574 /// <http://goo.gl/q1T4BB>
575 /// 575 ///
576 /// For now this is the only pattern we support. 576 /// For now this is the only pattern we support.
577 class InvalidSuperInvocation extends StaticError { 577 class InvalidSuperInvocation extends StaticError {
578 InvalidSuperInvocation(SuperConstructorInvocation node) : super(node); 578 InvalidSuperInvocation(SuperConstructorInvocation node) : super(node);
579 579
580 @override String get message => "super call must be last in an initializer " 580 @override String get message => "super call must be last in an initializer "
581 "list (see http://goo.gl/q1T4BB): {0}"; 581 "list (see http://goo.gl/q1T4BB): {0}";
582 } 582 }
OLDNEW
« no previous file with comments | « no previous file | test/checker/checker_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698