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

Side by Side Diff: pkg/analyzer/lib/src/dart/element/element.dart

Issue 2364733002: Issue 27300. Report HintCode.ABSTRACT_SUPER_MEMBER_REFERENCE. (Closed)
Patch Set: Fixes for false positives. Created 4 years, 2 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 | pkg/analyzer/lib/src/error/codes.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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 analyzer.src.dart.element.element; 5 library analyzer.src.dart.element.element;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 import 'dart:math' show min; 8 import 'dart:math' show min;
9 9
10 import 'package:analyzer/dart/ast/ast.dart'; 10 import 'package:analyzer/dart/ast/ast.dart';
(...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after
693 if (superElement != null) { 693 if (superElement != null) {
694 classesToVisit.add(superElement); 694 classesToVisit.add(superElement);
695 } 695 }
696 } 696 }
697 } 697 }
698 } 698 }
699 // not found 699 // not found
700 return false; 700 return false;
701 } 701 }
702 702
703 /**
704 * Return `true` if the class has a `noSuchMethod()` method distinct from the
705 * one declared in class `Object`, as per the Dart Language Specification
706 * (section 10.4).
707 */
708 bool get hasNoSuchMethod {
709 MethodElement method =
710 lookUpMethod(FunctionElement.NO_SUCH_METHOD_METHOD_NAME, library);
711 ClassElement definingClass = method?.enclosingElement;
712 return definingClass != null && !definingClass.type.isObject;
713 }
714
703 @override 715 @override
704 bool get hasReferenceToSuper => hasModifier(Modifier.REFERENCES_SUPER); 716 bool get hasReferenceToSuper => hasModifier(Modifier.REFERENCES_SUPER);
705 717
706 /** 718 /**
707 * Set whether this class references 'super'. 719 * Set whether this class references 'super'.
708 */ 720 */
709 void set hasReferenceToSuper(bool isReferencedSuper) { 721 void set hasReferenceToSuper(bool isReferencedSuper) {
710 setModifier(Modifier.REFERENCES_SUPER, isReferencedSuper); 722 setModifier(Modifier.REFERENCES_SUPER, isReferencedSuper);
711 } 723 }
712 724
(...skipping 7702 matching lines...) Expand 10 before | Expand all | Expand 10 after
8415 8427
8416 @override 8428 @override
8417 void visitElement(Element element) { 8429 void visitElement(Element element) {
8418 int offset = element.nameOffset; 8430 int offset = element.nameOffset;
8419 if (offset != -1) { 8431 if (offset != -1) {
8420 map[offset] = element; 8432 map[offset] = element;
8421 } 8433 }
8422 super.visitElement(element); 8434 super.visitElement(element);
8423 } 8435 }
8424 } 8436 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/error/codes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698