| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 elements; | 5 library elements; |
| 6 | 6 |
| 7 import '../common/resolution.dart' show |
| 8 Resolution; |
| 7 import '../compiler.dart' show | 9 import '../compiler.dart' show |
| 8 Compiler; | 10 Compiler; |
| 9 import '../constants/constructors.dart'; | 11 import '../constants/constructors.dart'; |
| 10 import '../constants/expressions.dart'; | 12 import '../constants/expressions.dart'; |
| 11 import '../dart_types.dart'; | 13 import '../dart_types.dart'; |
| 12 import '../diagnostics/diagnostic_listener.dart'; | 14 import '../diagnostics/diagnostic_listener.dart'; |
| 13 import '../diagnostics/messages.dart' show | 15 import '../diagnostics/messages.dart' show |
| 14 MessageKind; | 16 MessageKind; |
| 15 import '../diagnostics/source_span.dart' show | 17 import '../diagnostics/source_span.dart' show |
| 16 SourceSpan; | 18 SourceSpan; |
| (...skipping 943 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 960 /// | 962 /// |
| 961 /// For instance `F<dynamic>` for `typedef void F<T>(T t)`. | 963 /// For instance `F<dynamic>` for `typedef void F<T>(T t)`. |
| 962 TypedefType get rawType; | 964 TypedefType get rawType; |
| 963 | 965 |
| 964 /// The type, function type if well-defined, for which this typedef is an | 966 /// The type, function type if well-defined, for which this typedef is an |
| 965 /// alias. | 967 /// alias. |
| 966 /// | 968 /// |
| 967 /// For instance `(int)->void` for `typedef void F(int)`. | 969 /// For instance `(int)->void` for `typedef void F(int)`. |
| 968 DartType get alias; | 970 DartType get alias; |
| 969 | 971 |
| 970 void checkCyclicReference(Compiler compiler); | 972 void checkCyclicReference(Resolution resolution); |
| 971 } | 973 } |
| 972 | 974 |
| 973 /// An executable element is an element that can hold code. | 975 /// An executable element is an element that can hold code. |
| 974 /// | 976 /// |
| 975 /// These elements variables (fields, parameters and locals), which can hold | 977 /// These elements variables (fields, parameters and locals), which can hold |
| 976 /// code in their initializer, and functions (including methods and | 978 /// code in their initializer, and functions (including methods and |
| 977 /// constructors), which can hold code in their body. | 979 /// constructors), which can hold code in their body. |
| 978 abstract class ExecutableElement extends Element | 980 abstract class ExecutableElement extends Element |
| 979 implements TypedElement, AstElement { | 981 implements TypedElement, AstElement { |
| 980 /// The outermost member that contains this element. | 982 /// The outermost member that contains this element. |
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1308 /// The name of this type declaration, taking privacy into account. | 1310 /// The name of this type declaration, taking privacy into account. |
| 1309 Name get memberName; | 1311 Name get memberName; |
| 1310 | 1312 |
| 1311 /// Do not use [computeType] outside of the resolver; instead retrieve the | 1313 /// Do not use [computeType] outside of the resolver; instead retrieve the |
| 1312 /// type from the [thisType] or [rawType], depending on the use case. | 1314 /// type from the [thisType] or [rawType], depending on the use case. |
| 1313 /// | 1315 /// |
| 1314 /// Trying to access a type that has not been computed in resolution is an | 1316 /// Trying to access a type that has not been computed in resolution is an |
| 1315 /// error and calling [computeType] covers that error. | 1317 /// error and calling [computeType] covers that error. |
| 1316 /// This method will go away! | 1318 /// This method will go away! |
| 1317 @deprecated | 1319 @deprecated |
| 1318 GenericType computeType(Compiler compiler); | 1320 GenericType computeType(Resolution resolution); |
| 1319 | 1321 |
| 1320 /** | 1322 /** |
| 1321 * The `this type` for this type declaration. | 1323 * The `this type` for this type declaration. |
| 1322 * | 1324 * |
| 1323 * The type of [:this:] is the generic type based on this element in which | 1325 * The type of [:this:] is the generic type based on this element in which |
| 1324 * the type arguments are the declared type variables. For instance, | 1326 * the type arguments are the declared type variables. For instance, |
| 1325 * [:List<E>:] for [:List:] and [:Map<K,V>:] for [:Map:]. | 1327 * [:List<E>:] for [:List:] and [:Map<K,V>:] for [:Map:]. |
| 1326 * | 1328 * |
| 1327 * For a class declaration this is the type of [:this:]. | 1329 * For a class declaration this is the type of [:this:]. |
| 1328 */ | 1330 */ |
| (...skipping 19 matching lines...) Expand all Loading... |
| 1348 | 1350 |
| 1349 /** | 1351 /** |
| 1350 * The type variables declared on this declaration. The type variables are not | 1352 * The type variables declared on this declaration. The type variables are not |
| 1351 * available until the type of the element has been computed through | 1353 * available until the type of the element has been computed through |
| 1352 * [computeType]. | 1354 * [computeType]. |
| 1353 */ | 1355 */ |
| 1354 List<DartType> get typeVariables; | 1356 List<DartType> get typeVariables; |
| 1355 | 1357 |
| 1356 bool get isResolved; | 1358 bool get isResolved; |
| 1357 | 1359 |
| 1358 void ensureResolved(Compiler compiler); | 1360 void ensureResolved(Resolution resolution); |
| 1359 } | 1361 } |
| 1360 | 1362 |
| 1361 abstract class ClassElement extends TypeDeclarationElement | 1363 abstract class ClassElement extends TypeDeclarationElement |
| 1362 implements ScopeContainerElement { | 1364 implements ScopeContainerElement { |
| 1363 /// The length of the longest inheritance path from [:Object:]. | 1365 /// The length of the longest inheritance path from [:Object:]. |
| 1364 int get hierarchyDepth; | 1366 int get hierarchyDepth; |
| 1365 | 1367 |
| 1366 InterfaceType get rawType; | 1368 InterfaceType get rawType; |
| 1367 InterfaceType get thisType; | 1369 InterfaceType get thisType; |
| 1368 ClassElement get superclass; | 1370 ClassElement get superclass; |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1563 /// The front-end constant of this metadata annotation. | 1565 /// The front-end constant of this metadata annotation. |
| 1564 ConstantExpression get constant; | 1566 ConstantExpression get constant; |
| 1565 Element get annotatedElement; | 1567 Element get annotatedElement; |
| 1566 int get resolutionState; | 1568 int get resolutionState; |
| 1567 Token get beginToken; | 1569 Token get beginToken; |
| 1568 Token get endToken; | 1570 Token get endToken; |
| 1569 | 1571 |
| 1570 bool get hasNode; | 1572 bool get hasNode; |
| 1571 Node get node; | 1573 Node get node; |
| 1572 | 1574 |
| 1573 MetadataAnnotation ensureResolved(Compiler compiler); | 1575 MetadataAnnotation ensureResolved(Resolution resolution); |
| 1574 } | 1576 } |
| 1575 | 1577 |
| 1576 /// An [Element] that has a type. | 1578 /// An [Element] that has a type. |
| 1577 abstract class TypedElement extends Element { | 1579 abstract class TypedElement extends Element { |
| 1578 /// Do not use [computeType] outside of the resolver; instead retrieve the | 1580 /// Do not use [computeType] outside of the resolver; instead retrieve the |
| 1579 /// type from [type] property. | 1581 /// type from [type] property. |
| 1580 /// | 1582 /// |
| 1581 /// Trying to access a type that has not been computed in resolution is an | 1583 /// Trying to access a type that has not been computed in resolution is an |
| 1582 /// error and calling [computeType] covers that error. | 1584 /// error and calling [computeType] covers that error. |
| 1583 /// This method will go away! | 1585 /// This method will go away! |
| 1584 @deprecated | 1586 @deprecated |
| 1585 DartType computeType(Compiler compiler); | 1587 DartType computeType(Resolution resolution); |
| 1586 | 1588 |
| 1587 DartType get type; | 1589 DartType get type; |
| 1588 } | 1590 } |
| 1589 | 1591 |
| 1590 /// An [Element] that can define a function type. | 1592 /// An [Element] that can define a function type. |
| 1591 abstract class FunctionTypedElement extends Element { | 1593 abstract class FunctionTypedElement extends Element { |
| 1592 /// The function signature for the function type defined by this element, | 1594 /// The function signature for the function type defined by this element, |
| 1593 /// if any. | 1595 /// if any. |
| 1594 FunctionSignature get functionSignature; | 1596 FunctionSignature get functionSignature; |
| 1595 } | 1597 } |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1706 bool get isDeclaredByField; | 1708 bool get isDeclaredByField; |
| 1707 | 1709 |
| 1708 /// Returns `true` if this member is abstract. | 1710 /// Returns `true` if this member is abstract. |
| 1709 bool get isAbstract; | 1711 bool get isAbstract; |
| 1710 | 1712 |
| 1711 /// If abstract, [implementation] points to the overridden concrete member, | 1713 /// If abstract, [implementation] points to the overridden concrete member, |
| 1712 /// if any. Otherwise [implementation] points to the member itself. | 1714 /// if any. Otherwise [implementation] points to the member itself. |
| 1713 Member get implementation; | 1715 Member get implementation; |
| 1714 } | 1716 } |
| 1715 | 1717 |
| OLD | NEW |