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

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

Issue 1024553006: Issue 22962. Adding/removing method/accessor body is a declartion mismatch. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/element_handle.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 // This code was auto-generated, is not intended to be edited, and is subject to 5 // This code was auto-generated, is not intended to be edited, and is subject to
6 // significant change. Please see the README file for more information. 6 // significant change. Please see the README file for more information.
7 7
8 library engine.element; 8 library engine.element;
9 9
10 import 'dart:collection'; 10 import 'dart:collection';
(...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after
697 */ 697 */
698 void set mixinErrorsReported(bool value) { 698 void set mixinErrorsReported(bool value) {
699 setModifier(Modifier.MIXIN_ERRORS_REPORTED, value); 699 setModifier(Modifier.MIXIN_ERRORS_REPORTED, value);
700 } 700 }
701 701
702 @override 702 @override
703 AstNode get node { 703 AstNode get node {
704 if (isEnum) { 704 if (isEnum) {
705 return getNodeMatching((node) => node is EnumDeclaration); 705 return getNodeMatching((node) => node is EnumDeclaration);
706 } else { 706 } else {
707 return getNodeMatching((node) => node is ClassDeclaration || node is Class TypeAlias); 707 return getNodeMatching(
708 (node) => node is ClassDeclaration || node is ClassTypeAlias);
708 } 709 }
709 } 710 }
710 711
711 /** 712 /**
712 * Set whether this class is defined by a typedef construct. 713 * Set whether this class is defined by a typedef construct.
713 */ 714 */
714 void set typedef(bool isTypedef) { 715 void set typedef(bool isTypedef) {
715 setModifier(Modifier.TYPEDEF, isTypedef); 716 setModifier(Modifier.TYPEDEF, isTypedef);
716 } 717 }
717 718
(...skipping 2513 matching lines...) Expand 10 before | Expand all | Expand 10 after
3231 * constructors, getters, and setters. 3232 * constructors, getters, and setters.
3232 */ 3233 */
3233 abstract class ExecutableElement implements Element { 3234 abstract class ExecutableElement implements Element {
3234 /** 3235 /**
3235 * Return a list containing all of the functions defined within this 3236 * Return a list containing all of the functions defined within this
3236 * executable element. 3237 * executable element.
3237 */ 3238 */
3238 List<FunctionElement> get functions; 3239 List<FunctionElement> get functions;
3239 3240
3240 /** 3241 /**
3242 * Return `true` if this executable element is abstract.
3243 * Executable elements are abstract if they are not external and have no body.
3244 */
3245 bool get isAbstract;
3246
3247 /**
3241 * Return `true` if this executable element has body marked as being 3248 * Return `true` if this executable element has body marked as being
3242 * asynchronous. 3249 * asynchronous.
3243 */ 3250 */
3244 bool get isAsynchronous; 3251 bool get isAsynchronous;
3245 3252
3246 /** 3253 /**
3247 * Return `true` if this executable element has a body marked as being a 3254 * Return `true` if this executable element has a body marked as being a
3248 * generator. 3255 * generator.
3249 */ 3256 */
3250 bool get isGenerator; 3257 bool get isGenerator;
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
3375 } 3382 }
3376 3383
3377 /** 3384 /**
3378 * Set whether this method's body is a generator. 3385 * Set whether this method's body is a generator.
3379 */ 3386 */
3380 void set generator(bool isGenerator) { 3387 void set generator(bool isGenerator) {
3381 setModifier(Modifier.GENERATOR, isGenerator); 3388 setModifier(Modifier.GENERATOR, isGenerator);
3382 } 3389 }
3383 3390
3384 @override 3391 @override
3392 bool get isAbstract => hasModifier(Modifier.ABSTRACT);
3393
3394 @override
3385 bool get isAsynchronous => hasModifier(Modifier.ASYNCHRONOUS); 3395 bool get isAsynchronous => hasModifier(Modifier.ASYNCHRONOUS);
3386 3396
3387 @override 3397 @override
3388 bool get isGenerator => hasModifier(Modifier.GENERATOR); 3398 bool get isGenerator => hasModifier(Modifier.GENERATOR);
3389 3399
3390 @override 3400 @override
3391 bool get isOperator => false; 3401 bool get isOperator => false;
3392 3402
3393 @override 3403 @override
3394 bool get isSynchronous => !hasModifier(Modifier.ASYNCHRONOUS); 3404 bool get isSynchronous => !hasModifier(Modifier.ASYNCHRONOUS);
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
3530 List<FunctionElement> get functions { 3540 List<FunctionElement> get functions {
3531 // 3541 //
3532 // Elements within this element should have type parameters substituted, 3542 // Elements within this element should have type parameters substituted,
3533 // just like this element. 3543 // just like this element.
3534 // 3544 //
3535 throw new UnsupportedOperationException(); 3545 throw new UnsupportedOperationException();
3536 // return getBaseElement().getFunctions(); 3546 // return getBaseElement().getFunctions();
3537 } 3547 }
3538 3548
3539 @override 3549 @override
3550 bool get isAbstract => baseElement.isAbstract;
3551
3552 @override
3540 bool get isAsynchronous => baseElement.isAsynchronous; 3553 bool get isAsynchronous => baseElement.isAsynchronous;
3541 3554
3542 @override 3555 @override
3543 bool get isGenerator => baseElement.isGenerator; 3556 bool get isGenerator => baseElement.isGenerator;
3544 3557
3545 @override 3558 @override
3546 bool get isOperator => baseElement.isOperator; 3559 bool get isOperator => baseElement.isOperator;
3547 3560
3548 @override 3561 @override
3549 bool get isStatic => baseElement.isStatic; 3562 bool get isStatic => baseElement.isStatic;
(...skipping 4011 matching lines...) Expand 10 before | Expand all | Expand 10 after
7561 void visitChildren(ElementVisitor visitor) { 7574 void visitChildren(ElementVisitor visitor) {
7562 // There are no children to visit 7575 // There are no children to visit
7563 } 7576 }
7564 } 7577 }
7565 7578
7566 /** 7579 /**
7567 * An element that represents a method defined within a type. 7580 * An element that represents a method defined within a type.
7568 */ 7581 */
7569 abstract class MethodElement implements ClassMemberElement, ExecutableElement { 7582 abstract class MethodElement implements ClassMemberElement, ExecutableElement {
7570 /** 7583 /**
7571 * Return `true` if this method is abstract. Methods are abstract if they are
7572 * not external and have no body.
7573 */
7574 bool get isAbstract;
7575
7576 /**
7577 * Return the resolved [MethodDeclaration] node that declares this 7584 * Return the resolved [MethodDeclaration] node that declares this
7578 * [MethodElement]. 7585 * [MethodElement].
7579 * 7586 *
7580 * This method is expensive, because resolved AST might be evicted from cache, 7587 * This method is expensive, because resolved AST might be evicted from cache,
7581 * so parsing and resolving will be performed. 7588 * so parsing and resolving will be performed.
7582 */ 7589 */
7583 @override 7590 @override
7584 MethodDeclaration get node; 7591 MethodDeclaration get node;
7585 } 7592 }
7586 7593
(...skipping 30 matching lines...) Expand all
7617 if ("unary-" == displayName) { 7624 if ("unary-" == displayName) {
7618 return "-"; 7625 return "-";
7619 } 7626 }
7620 return displayName; 7627 return displayName;
7621 } 7628 }
7622 7629
7623 @override 7630 @override
7624 ClassElement get enclosingElement => super.enclosingElement as ClassElement; 7631 ClassElement get enclosingElement => super.enclosingElement as ClassElement;
7625 7632
7626 @override 7633 @override
7627 bool get isAbstract => hasModifier(Modifier.ABSTRACT);
7628
7629 @override
7630 bool get isOperator { 7634 bool get isOperator {
7631 String name = displayName; 7635 String name = displayName;
7632 if (name.isEmpty) { 7636 if (name.isEmpty) {
7633 return false; 7637 return false;
7634 } 7638 }
7635 int first = name.codeUnitAt(0); 7639 int first = name.codeUnitAt(0);
7636 return !((0x61 <= first && first <= 0x7A) || 7640 return !((0x61 <= first && first <= 0x7A) ||
7637 (0x41 <= first && first <= 0x5A) || 7641 (0x41 <= first && first <= 0x5A) ||
7638 first == 0x5F || 7642 first == 0x5F ||
7639 first == 0x24); 7643 first == 0x24);
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
7691 MethodMember(MethodElement baseElement, InterfaceType definingType) 7695 MethodMember(MethodElement baseElement, InterfaceType definingType)
7692 : super(baseElement, definingType); 7696 : super(baseElement, definingType);
7693 7697
7694 @override 7698 @override
7695 MethodElement get baseElement => super.baseElement as MethodElement; 7699 MethodElement get baseElement => super.baseElement as MethodElement;
7696 7700
7697 @override 7701 @override
7698 ClassElement get enclosingElement => baseElement.enclosingElement; 7702 ClassElement get enclosingElement => baseElement.enclosingElement;
7699 7703
7700 @override 7704 @override
7701 bool get isAbstract => baseElement.isAbstract;
7702
7703 @override
7704 MethodDeclaration get node => baseElement.node; 7705 MethodDeclaration get node => baseElement.node;
7705 7706
7706 @override 7707 @override
7707 accept(ElementVisitor visitor) => visitor.visitMethodElement(this); 7708 accept(ElementVisitor visitor) => visitor.visitMethodElement(this);
7708 7709
7709 @override 7710 @override
7710 String toString() { 7711 String toString() {
7711 MethodElement baseElement = this.baseElement; 7712 MethodElement baseElement = this.baseElement;
7712 List<ParameterElement> parameters = this.parameters; 7713 List<ParameterElement> parameters = this.parameters;
7713 FunctionType type = this.type; 7714 FunctionType type = this.type;
(...skipping 909 matching lines...) Expand 10 before | Expand all | Expand 10 after
8623 PropertyAccessorElement get correspondingGetter; 8624 PropertyAccessorElement get correspondingGetter;
8624 8625
8625 /** 8626 /**
8626 * Return the accessor representing the setter that corresponds to (has the 8627 * Return the accessor representing the setter that corresponds to (has the
8627 * same name as) this getter, or `null` if this accessor is not a getter or if 8628 * same name as) this getter, or `null` if this accessor is not a getter or if
8628 * there is no corresponding setter. 8629 * there is no corresponding setter.
8629 */ 8630 */
8630 PropertyAccessorElement get correspondingSetter; 8631 PropertyAccessorElement get correspondingSetter;
8631 8632
8632 /** 8633 /**
8633 * Return `true` if this accessor is abstract. Accessors are abstract if they
8634 * are not external and have no body.
8635 */
8636 bool get isAbstract;
8637
8638 /**
8639 * Return `true` if this accessor represents a getter. 8634 * Return `true` if this accessor represents a getter.
8640 */ 8635 */
8641 bool get isGetter; 8636 bool get isGetter;
8642 8637
8643 /** 8638 /**
8644 * Return `true` if this accessor represents a setter. 8639 * Return `true` if this accessor represents a setter.
8645 */ 8640 */
8646 bool get isSetter; 8641 bool get isSetter;
8647 8642
8648 /** 8643 /**
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
8720 int get hashCode => JenkinsSmiHash.hash2(super.hashCode, isGetter ? 1 : 2); 8715 int get hashCode => JenkinsSmiHash.hash2(super.hashCode, isGetter ? 1 : 2);
8721 8716
8722 @override 8717 @override
8723 String get identifier { 8718 String get identifier {
8724 String name = displayName; 8719 String name = displayName;
8725 String suffix = isGetter ? "?" : "="; 8720 String suffix = isGetter ? "?" : "=";
8726 return "$name$suffix"; 8721 return "$name$suffix";
8727 } 8722 }
8728 8723
8729 @override 8724 @override
8730 bool get isAbstract => hasModifier(Modifier.ABSTRACT);
8731
8732 @override
8733 bool get isGetter => hasModifier(Modifier.GETTER); 8725 bool get isGetter => hasModifier(Modifier.GETTER);
8734 8726
8735 @override 8727 @override
8736 bool get isSetter => hasModifier(Modifier.SETTER); 8728 bool get isSetter => hasModifier(Modifier.SETTER);
8737 8729
8738 @override 8730 @override
8739 bool get isStatic => hasModifier(Modifier.STATIC); 8731 bool get isStatic => hasModifier(Modifier.STATIC);
8740 8732
8741 @override 8733 @override
8742 ElementKind get kind { 8734 ElementKind get kind {
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
8823 PropertyAccessorElement get correspondingSetter => 8815 PropertyAccessorElement get correspondingSetter =>
8824 from(baseElement.correspondingSetter, definingType); 8816 from(baseElement.correspondingSetter, definingType);
8825 8817
8826 @override 8818 @override
8827 InterfaceType get definingType => super.definingType as InterfaceType; 8819 InterfaceType get definingType => super.definingType as InterfaceType;
8828 8820
8829 @override 8821 @override
8830 Element get enclosingElement => baseElement.enclosingElement; 8822 Element get enclosingElement => baseElement.enclosingElement;
8831 8823
8832 @override 8824 @override
8833 bool get isAbstract => baseElement.isAbstract;
8834
8835 @override
8836 bool get isGetter => baseElement.isGetter; 8825 bool get isGetter => baseElement.isGetter;
8837 8826
8838 @override 8827 @override
8839 bool get isSetter => baseElement.isSetter; 8828 bool get isSetter => baseElement.isSetter;
8840 8829
8841 @override 8830 @override
8842 PropertyInducingElement get variable { 8831 PropertyInducingElement get variable {
8843 PropertyInducingElement variable = baseElement.variable; 8832 PropertyInducingElement variable = baseElement.variable;
8844 if (variable is FieldElement) { 8833 if (variable is FieldElement) {
8845 return FieldMember.from(variable, definingType); 8834 return FieldMember.from(variable, definingType);
(...skipping 1617 matching lines...) Expand 10 before | Expand all | Expand 10 after
10463 // void <: void (by reflexivity) 10452 // void <: void (by reflexivity)
10464 // bottom <: void (as bottom is a subtype of all types). 10453 // bottom <: void (as bottom is a subtype of all types).
10465 // void <: dynamic (as dynamic is a supertype of all types) 10454 // void <: dynamic (as dynamic is a supertype of all types)
10466 return identical(type, this) || type.isDynamic; 10455 return identical(type, this) || type.isDynamic;
10467 } 10456 }
10468 10457
10469 @override 10458 @override
10470 VoidTypeImpl substitute2( 10459 VoidTypeImpl substitute2(
10471 List<DartType> argumentTypes, List<DartType> parameterTypes) => this; 10460 List<DartType> argumentTypes, List<DartType> parameterTypes) => this;
10472 } 10461 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/element_handle.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698