OLD | NEW |
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 library analyzer.src.dart.element.member; | 5 library analyzer.src.dart.element.member; |
6 | 6 |
7 import 'package:analyzer/dart/ast/ast.dart'; | 7 import 'package:analyzer/dart/ast/ast.dart'; |
8 import 'package:analyzer/dart/constant/value.dart'; | 8 import 'package:analyzer/dart/constant/value.dart'; |
9 import 'package:analyzer/dart/element/element.dart'; | 9 import 'package:analyzer/dart/element/element.dart'; |
10 import 'package:analyzer/dart/element/type.dart'; | 10 import 'package:analyzer/dart/element/type.dart'; |
(...skipping 933 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
944 @override | 944 @override |
945 Element get enclosingElement => baseElement.enclosingElement; | 945 Element get enclosingElement => baseElement.enclosingElement; |
946 | 946 |
947 @override | 947 @override |
948 int get hashCode => baseElement.hashCode; | 948 int get hashCode => baseElement.hashCode; |
949 | 949 |
950 @override | 950 @override |
951 TypeParameterType get type => _type; | 951 TypeParameterType get type => _type; |
952 | 952 |
953 @override | 953 @override |
954 bool operator ==(obj) => | |
955 // TODO(jmesserly): this equality should consider the bound, see: | |
956 // https://github.com/dart-lang/sdk/issues/27210 | |
957 obj is TypeParameterMember && obj.baseElement == baseElement; | |
958 | |
959 @override | |
960 accept(ElementVisitor visitor) => visitor.visitTypeParameterElement(this); | 954 accept(ElementVisitor visitor) => visitor.visitTypeParameterElement(this); |
961 | 955 |
962 /** | 956 /** |
963 * If the given [parameter]'s type is different when any type parameters from | 957 * If the given [parameter]'s type is different when any type parameters from |
964 * the defining type's declaration are replaced with the actual type | 958 * the defining type's declaration are replaced with the actual type |
965 * arguments from the [definingType], create a parameter member representing | 959 * arguments from the [definingType], create a parameter member representing |
966 * the given parameter. Return the member that was created, or the base | 960 * the given parameter. Return the member that was created, or the base |
967 * parameter if no member was created. | 961 * parameter if no member was created. |
968 */ | 962 */ |
969 static TypeParameterElement from( | 963 static TypeParameterElement from( |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1049 DartObject computeConstantValue() => baseElement.computeConstantValue(); | 1043 DartObject computeConstantValue() => baseElement.computeConstantValue(); |
1050 | 1044 |
1051 @override | 1045 @override |
1052 void visitChildren(ElementVisitor visitor) { | 1046 void visitChildren(ElementVisitor visitor) { |
1053 // TODO(brianwilkerson) We need to finish implementing the accessors used | 1047 // TODO(brianwilkerson) We need to finish implementing the accessors used |
1054 // below so that we can safely invoke them. | 1048 // below so that we can safely invoke them. |
1055 super.visitChildren(visitor); | 1049 super.visitChildren(visitor); |
1056 baseElement.initializer?.accept(visitor); | 1050 baseElement.initializer?.accept(visitor); |
1057 } | 1051 } |
1058 } | 1052 } |
OLD | NEW |