OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 import '../common_elements.dart'; | 5 import '../common_elements.dart'; |
6 import '../util/util.dart' show equalElements; | 6 import '../util/util.dart' show equalElements; |
7 import 'entities.dart'; | 7 import 'entities.dart'; |
8 | 8 |
9 /// Hierarchy to describe types in Dart. | 9 /// Hierarchy to describe types in Dart. |
10 /// | 10 /// |
11 /// This hierarchy is a super hierarchy of the use-case specific hierarchies | 11 /// This hierarchy is a super hierarchy of the use-case specific hierarchies |
12 /// used in different parts of the compiler. This hierarchy abstracts details | 12 /// used in different parts of the compiler. This hierarchy abstracts details |
13 /// not generally needed or required for the Dart type hierarchy. For instance, | 13 /// not generally needed or required for the Dart type hierarchy. For instance, |
14 /// the hierarchy in 'resolution_types.dart' has properties supporting lazy | 14 /// the hierarchy in 'resolution_types.dart' has properties supporting lazy |
15 /// computation (like computeAlias) and distinctions between 'Foo' and | 15 /// computation (like computeAlias) and distinctions between 'Foo' and |
16 /// 'Foo<dynamic>', features that are not needed for code generation and not | 16 /// 'Foo<dynamic>', features that are not needed for code generation and not |
17 /// supported from kernel. | 17 /// supported from kernel. |
18 /// | 18 /// |
19 /// Current only 'resolution_types.dart' implement this hierarchy but when the | 19 /// Current only 'resolution_types.dart' implement this hierarchy but when the |
20 /// compiler moves to use [Entity] instead of [Element] this hierarchy can be | 20 /// compiler moves to use [Entity] instead of [Element] this hierarchy can be |
21 /// implementated directly but other entity systems, for instance based directly | 21 /// implemented directly but other entity systems, for instance based directly |
22 /// on kernel ir without the need for [Element]. | 22 /// on kernel ir without the need for [Element]. |
23 | 23 |
24 abstract class DartType { | 24 abstract class DartType { |
25 const DartType(); | 25 const DartType(); |
26 | 26 |
27 /// Returns the unaliased type of this type. | 27 /// Returns the unaliased type of this type. |
28 /// | 28 /// |
29 /// The unaliased type of a typedef'd type is the unaliased type to which its | 29 /// The unaliased type of a typedef'd type is the unaliased type to which its |
30 /// name is bound. The unaliased version of any other type is the type itself. | 30 /// name is bound. The unaliased version of any other type is the type itself. |
31 /// | 31 /// |
(...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
813 // include a runtime value for method type variables this must be updated. | 813 // include a runtime value for method type variables this must be updated. |
814 // For full support the global assumption that all type variables are | 814 // For full support the global assumption that all type variables are |
815 // declared by the same enclosing class will not hold: Both an enclosing | 815 // declared by the same enclosing class will not hold: Both an enclosing |
816 // method and an enclosing class may define type variables, so the return | 816 // method and an enclosing class may define type variables, so the return |
817 // type cannot be [ClassElement] and the caller must be prepared to look in | 817 // type cannot be [ClassElement] and the caller must be prepared to look in |
818 // two locations, not one. Currently we ignore method type variables by | 818 // two locations, not one. Currently we ignore method type variables by |
819 // returning in the next statement. | 819 // returning in the next statement. |
820 return contextClass; | 820 return contextClass; |
821 } | 821 } |
822 } | 822 } |
OLD | NEW |