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

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

Issue 2366963002: Issue 27300. Report HintCode.ABSTRACT_SUPER_MEMBER_REFERENCE. (Land again) (Closed)
Patch Set: 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
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 681 matching lines...) Expand 10 before | Expand all | Expand 10 after
692 if (superElement != null) { 692 if (superElement != null) {
693 classesToVisit.add(superElement); 693 classesToVisit.add(superElement);
694 } 694 }
695 } 695 }
696 } 696 }
697 } 697 }
698 // not found 698 // not found
699 return false; 699 return false;
700 } 700 }
701 701
702 /**
703 * Return `true` if the class has a `noSuchMethod()` method distinct from the
704 * one declared in class `Object`, as per the Dart Language Specification
705 * (section 10.4).
706 */
707 bool get hasNoSuchMethod {
708 MethodElement method =
709 lookUpMethod(FunctionElement.NO_SUCH_METHOD_METHOD_NAME, library);
710 ClassElement definingClass = method?.enclosingElement;
711 return definingClass != null && !definingClass.type.isObject;
712 }
713
702 @override 714 @override
703 bool get hasReferenceToSuper => hasModifier(Modifier.REFERENCES_SUPER); 715 bool get hasReferenceToSuper => hasModifier(Modifier.REFERENCES_SUPER);
704 716
705 /** 717 /**
706 * Set whether this class references 'super'. 718 * Set whether this class references 'super'.
707 */ 719 */
708 void set hasReferenceToSuper(bool isReferencedSuper) { 720 void set hasReferenceToSuper(bool isReferencedSuper) {
709 setModifier(Modifier.REFERENCES_SUPER, isReferencedSuper); 721 setModifier(Modifier.REFERENCES_SUPER, isReferencedSuper);
710 } 722 }
711 723
(...skipping 7721 matching lines...) Expand 10 before | Expand all | Expand 10 after
8433 8445
8434 @override 8446 @override
8435 void visitElement(Element element) { 8447 void visitElement(Element element) {
8436 int offset = element.nameOffset; 8448 int offset = element.nameOffset;
8437 if (offset != -1) { 8449 if (offset != -1) {
8438 map[offset] = element; 8450 map[offset] = element;
8439 } 8451 }
8440 super.visitElement(element); 8452 super.visitElement(element);
8441 } 8453 }
8442 } 8454 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/test/integration/analysis/error_test.dart ('k') | pkg/analyzer/lib/src/error/codes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698