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

Side by Side Diff: pkg/analyzer/lib/src/task/strong/info.dart

Issue 1430953004: Check field overrides (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: fix typo Created 5 years, 1 month 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
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 // TODO(jmesserly): this was ported from package:dev_compiler, and needs to be 7 // TODO(jmesserly): this was ported from package:dev_compiler, and needs to be
8 // refactored to fit into analyzer. 8 // refactored to fit into analyzer.
9 library analyzer.src.task.strong.info; 9 library analyzer.src.task.strong.info;
10 10
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 // Invalid override due to incompatible type. I.e., the overridden signature 445 // Invalid override due to incompatible type. I.e., the overridden signature
446 // is not compatible with the original. 446 // is not compatible with the original.
447 class InvalidMethodOverride extends InvalidOverride { 447 class InvalidMethodOverride extends InvalidOverride {
448 InvalidMethodOverride(AstNode node, ExecutableElement element, 448 InvalidMethodOverride(AstNode node, ExecutableElement element,
449 InterfaceType base, FunctionType subType, FunctionType baseType) 449 InterfaceType base, FunctionType subType, FunctionType baseType)
450 : super(node, element, base, subType, baseType); 450 : super(node, element, base, subType, baseType);
451 451
452 String get message => _messageHelper('Invalid override'); 452 String get message => _messageHelper('Invalid override');
453 } 453 }
454 454
455 class InvalidFieldOverride extends InvalidOverride {
456 InvalidFieldOverride(AstNode node, ExecutableElement element,
457 InterfaceType base, DartType subType, DartType baseType)
458 : super(node, element, base, subType, baseType);
459
460 String get message => 'Field declaration {3}.{1} cannot be '
461 'overridden in {0}.';
462 }
463
455 /// Dart constructors have one weird quirk, illustrated with this example: 464 /// Dart constructors have one weird quirk, illustrated with this example:
456 /// 465 ///
457 /// class Base { 466 /// class Base {
458 /// var x; 467 /// var x;
459 /// Base() : x = print('Base.1') { 468 /// Base() : x = print('Base.1') {
460 /// print('Base.2'); 469 /// print('Base.2');
461 /// } 470 /// }
462 /// } 471 /// }
463 /// 472 ///
464 /// class Derived extends Base { 473 /// class Derived extends Base {
(...skipping 15 matching lines...) Expand all
480 /// Better to have `super` at the end, as required by the Dart style guide: 489 /// Better to have `super` at the end, as required by the Dart style guide:
481 /// <http://goo.gl/q1T4BB> 490 /// <http://goo.gl/q1T4BB>
482 /// 491 ///
483 /// For now this is the only pattern we support. 492 /// For now this is the only pattern we support.
484 class InvalidSuperInvocation extends StaticError { 493 class InvalidSuperInvocation extends StaticError {
485 InvalidSuperInvocation(SuperConstructorInvocation node) : super(node); 494 InvalidSuperInvocation(SuperConstructorInvocation node) : super(node);
486 495
487 @override String get message => "super call must be last in an initializer " 496 @override String get message => "super call must be last in an initializer "
488 "list (see http://goo.gl/q1T4BB): {0}"; 497 "list (see http://goo.gl/q1T4BB): {0}";
489 } 498 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/task/strong/checker.dart ('k') | pkg/analyzer/test/src/task/strong/checker_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698