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 '../closure.dart'; | 5 import '../closure.dart'; |
6 import '../common.dart'; | 6 import '../common.dart'; |
7 import '../elements/elements.dart'; | 7 import '../elements/elements.dart'; |
8 import '../elements/entities.dart'; | 8 import '../elements/entities.dart'; |
9 import '../elements/types.dart'; | 9 import '../elements/types.dart'; |
10 import '../io/source_information.dart'; | 10 import '../io/source_information.dart'; |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 | 81 |
82 CommonMasks get commonMasks => closedWorld.commonMasks; | 82 CommonMasks get commonMasks => closedWorld.commonMasks; |
83 | 83 |
84 GlobalTypeInferenceResults get _globalInferenceResults => | 84 GlobalTypeInferenceResults get _globalInferenceResults => |
85 builder.globalInferenceResults; | 85 builder.globalInferenceResults; |
86 | 86 |
87 /// Substituted type variables occurring in [type] into the context of | 87 /// Substituted type variables occurring in [type] into the context of |
88 /// [contextClass]. | 88 /// [contextClass]. |
89 DartType substInContext(DartType type) { | 89 DartType substInContext(DartType type) { |
90 if (contextClass != null) { | 90 if (contextClass != null) { |
91 ClassElement typeContext = DartTypes.getClassContext(type); | 91 ClassEntity typeContext = DartTypes.getClassContext(type); |
92 if (typeContext != null) { | 92 if (typeContext != null) { |
93 type = builder.types.substByContext( | 93 type = builder.types.substByContext( |
94 type, | 94 type, |
95 builder.types.asInstanceOf( | 95 builder.types.asInstanceOf( |
96 builder.types.getThisType(contextClass), typeContext)); | 96 builder.types.getThisType(contextClass), typeContext)); |
97 } | 97 } |
98 } | 98 } |
99 if (instanceType != null) { | 99 if (instanceType != null) { |
100 type = builder.types.substByContext(type, instanceType); | 100 type = builder.types.substByContext(type, instanceType); |
101 } | 101 } |
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
673 final MemberEntity memberContext; | 673 final MemberEntity memberContext; |
674 | 674 |
675 // Avoid slow Object.hashCode. | 675 // Avoid slow Object.hashCode. |
676 final int hashCode = _nextHashCode = (_nextHashCode + 1).toUnsigned(30); | 676 final int hashCode = _nextHashCode = (_nextHashCode + 1).toUnsigned(30); |
677 static int _nextHashCode = 0; | 677 static int _nextHashCode = 0; |
678 | 678 |
679 SyntheticLocal(this.name, this.executableContext, this.memberContext); | 679 SyntheticLocal(this.name, this.executableContext, this.memberContext); |
680 | 680 |
681 toString() => 'SyntheticLocal($name)'; | 681 toString() => 'SyntheticLocal($name)'; |
682 } | 682 } |
OLD | NEW |