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/generated/element.dart

Issue 790103002: New getter: FieldElement.isEnumConstant (Dart version of source) (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years 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 4836 matching lines...) Expand 10 before | Expand all | Expand 10 after
4847 accept(ElementVisitor visitor) => 4847 accept(ElementVisitor visitor) =>
4848 visitor.visitExternalHtmlScriptElement(this); 4848 visitor.visitExternalHtmlScriptElement(this);
4849 } 4849 }
4850 4850
4851 /** 4851 /**
4852 * The interface `FieldElement` defines the behavior of elements representing a field defined 4852 * The interface `FieldElement` defines the behavior of elements representing a field defined
4853 * within a type. 4853 * within a type.
4854 */ 4854 */
4855 abstract class FieldElement implements ClassMemberElement, 4855 abstract class FieldElement implements ClassMemberElement,
4856 PropertyInducingElement { 4856 PropertyInducingElement {
4857 /**
4858 * Return {@code true} if this element is an enum constant.
4859 *
4860 * @return {@code true} if this an enum constant
4861 */
4862 bool get isEnumConstant;
4857 } 4863 }
4858 4864
4859 /** 4865 /**
4860 * Instances of the class `FieldElementImpl` implement a `FieldElement`. 4866 * Instances of the class `FieldElementImpl` implement a `FieldElement`.
4861 */ 4867 */
4862 class FieldElementImpl extends PropertyInducingElementImpl implements 4868 class FieldElementImpl extends PropertyInducingElementImpl implements
4863 FieldElement { 4869 FieldElement {
4864 /** 4870 /**
4865 * An empty list of field elements. 4871 * An empty list of field elements.
4866 */ 4872 */
(...skipping 28 matching lines...) Expand all
4895 * Set whether this field is static to correspond to the given value. 4901 * Set whether this field is static to correspond to the given value.
4896 * 4902 *
4897 * @param isStatic `true` if the field is static 4903 * @param isStatic `true` if the field is static
4898 */ 4904 */
4899 void set static(bool isStatic) { 4905 void set static(bool isStatic) {
4900 setModifier(Modifier.STATIC, isStatic); 4906 setModifier(Modifier.STATIC, isStatic);
4901 } 4907 }
4902 4908
4903 @override 4909 @override
4904 accept(ElementVisitor visitor) => visitor.visitFieldElement(this); 4910 accept(ElementVisitor visitor) => visitor.visitFieldElement(this);
4911
4912 @override
4913 bool get isEnumConstant =>
4914 enclosingElement != null ? enclosingElement.isEnum : false;
4905 } 4915 }
4906 4916
4907 /** 4917 /**
4908 * The interface `FieldFormalParameterElement` defines the behavior of elements representing a 4918 * The interface `FieldFormalParameterElement` defines the behavior of elements representing a
4909 * field formal parameter defined within a constructor element. 4919 * field formal parameter defined within a constructor element.
4910 */ 4920 */
4911 abstract class FieldFormalParameterElement implements ParameterElement { 4921 abstract class FieldFormalParameterElement implements ParameterElement {
4912 /** 4922 /**
4913 * Return the field element associated with this field formal parameter, or `n ull` if the 4923 * Return the field element associated with this field formal parameter, or `n ull` if the
4914 * parameter references a field that doesn't exist. 4924 * parameter references a field that doesn't exist.
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
5067 if (basePropagatedType != null) { 5077 if (basePropagatedType != null) {
5068 DartType substitutedPropagatedType = 5078 DartType substitutedPropagatedType =
5069 basePropagatedType.substitute2(argumentTypes, parameterTypes); 5079 basePropagatedType.substitute2(argumentTypes, parameterTypes);
5070 if (basePropagatedType != substitutedPropagatedType) { 5080 if (basePropagatedType != substitutedPropagatedType) {
5071 return true; 5081 return true;
5072 } 5082 }
5073 } 5083 }
5074 } 5084 }
5075 return false; 5085 return false;
5076 } 5086 }
5087
5088 @override
5089 bool get isEnumConstant => baseElement.isEnumConstant;
5077 } 5090 }
5078 5091
5079 /** 5092 /**
5080 * The interface `FunctionElement` defines the behavior of elements representing a function. 5093 * The interface `FunctionElement` defines the behavior of elements representing a function.
5081 */ 5094 */
5082 abstract class FunctionElement implements ExecutableElement, LocalElement { 5095 abstract class FunctionElement implements ExecutableElement, LocalElement {
5083 /** 5096 /**
5084 * The name of the method that can be implemented by a class to allow its inst ances to be invoked 5097 * The name of the method that can be implemented by a class to allow its inst ances to be invoked
5085 * as if they were a function. 5098 * as if they were a function.
5086 */ 5099 */
(...skipping 7494 matching lines...) Expand 10 before | Expand all | Expand 10 after
12581 // bottom <: void (as bottom is a subtype of all types). 12594 // bottom <: void (as bottom is a subtype of all types).
12582 // void <: dynamic (as dynamic is a supertype of all types) 12595 // void <: dynamic (as dynamic is a supertype of all types)
12583 return identical(type, this) || type.isDynamic; 12596 return identical(type, this) || type.isDynamic;
12584 } 12597 }
12585 12598
12586 @override 12599 @override
12587 VoidTypeImpl substitute2(List<DartType> argumentTypes, 12600 VoidTypeImpl substitute2(List<DartType> argumentTypes,
12588 List<DartType> parameterTypes) => 12601 List<DartType> parameterTypes) =>
12589 this; 12602 this;
12590 } 12603 }
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