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

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

Issue 1228063003: fix for 1.12.0-dev SDK and 0.25.1 analyzer breaking changes (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 5 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
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 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 /// Whether the error comes from a mixin (either overriding a base class or an 437 /// Whether the error comes from a mixin (either overriding a base class or an
438 /// interface declaration). 438 /// interface declaration).
439 final bool fromMixin; 439 final bool fromMixin;
440 440
441 InvalidOverride( 441 InvalidOverride(
442 AstNode node, this.element, this.base, this.subType, this.baseType) 442 AstNode node, this.element, this.base, this.subType, this.baseType)
443 : fromBaseClass = node is ExtendsClause, 443 : fromBaseClass = node is ExtendsClause,
444 fromMixin = node.parent is WithClause, 444 fromMixin = node.parent is WithClause,
445 super(node); 445 super(node);
446 446
447 ClassDeclaration get parent => 447 ClassElement get parent => element.enclosingElement;
Jennifer Messerly 2015/07/09 17:03:29 all we do here is get the name ... so we were pote
vsm 2015/07/09 17:09:56 yikes - good catch!
448 element.enclosingElement.node as ClassDeclaration;
449 448
450 String _messageHelper(String errorName) { 449 String _messageHelper(String errorName) {
451 var name = element.name; 450 var name = element.name;
452 var lcErrorName = errorName.toLowerCase(); 451 var lcErrorName = errorName.toLowerCase();
453 var intro = fromBaseClass 452 var intro = fromBaseClass
454 ? 'Base class introduces an $lcErrorName' 453 ? 'Base class introduces an $lcErrorName'
455 : (fromMixin ? 'Mixin introduces an $lcErrorName' : errorName); 454 : (fromMixin ? 'Mixin introduces an $lcErrorName' : errorName);
456 return '$intro. The type of ${parent.name}.$name ($subType) is not a ' 455 return '$intro. The type of ${parent.name}.$name ($subType) is not a '
457 'subtype of $base.$name ($baseType).'; 456 'subtype of $base.$name ($baseType).';
458 } 457 }
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 var isError = severity == ErrorSeverity.WARNING; 534 var isError = severity == ErrorSeverity.WARNING;
536 var level = isError ? Level.SEVERE : Level.WARNING; 535 var level = isError ? Level.SEVERE : Level.WARNING;
537 int begin = error.offset; 536 int begin = error.offset;
538 int end = begin + error.length; 537 int end = begin + error.length;
539 return new AnalyzerMessage(error.message, level, begin, end); 538 return new AnalyzerMessage(error.message, level, begin, end);
540 } 539 }
541 540
542 const AnalyzerMessage(String message, Level level, int begin, int end) 541 const AnalyzerMessage(String message, Level level, int begin, int end)
543 : super(message, level, begin, end); 542 : super(message, level, begin, end);
544 } 543 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698