Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(249)

Side by Side Diff: pkg/analyzer/lib/src/dart/element/member.dart

Issue 1568643002: clean up generic methods in resolution (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 months 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
« no previous file with comments | « pkg/analyzer/lib/dart/element/type.dart ('k') | pkg/analyzer/lib/src/dart/element/type.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 library analyzer.src.dart.element.member; 5 library analyzer.src.dart.element.member;
6 6
7 import 'package:analyzer/dart/element/element.dart'; 7 import 'package:analyzer/dart/element/element.dart';
8 import 'package:analyzer/dart/element/type.dart'; 8 import 'package:analyzer/dart/element/type.dart';
9 import 'package:analyzer/src/dart/element/element.dart'; 9 import 'package:analyzer/src/dart/element/element.dart';
10 import 'package:analyzer/src/dart/element/type.dart'; 10 import 'package:analyzer/src/dart/element/type.dart';
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 if (basePropagatedType != substitutedPropagatedType) { 332 if (basePropagatedType != substitutedPropagatedType) {
333 return true; 333 return true;
334 } 334 }
335 } 335 }
336 } 336 }
337 return false; 337 return false;
338 } 338 }
339 } 339 }
340 340
341 /** 341 /**
342 * Deprecated: this type is no longer used. Use
343 * [MethodInvocation.staticInvokeType] to get the instantiated type of a generic
344 * method invocation.
345 *
342 * An element of a generic function, where the type parameters are known. 346 * An element of a generic function, where the type parameters are known.
343 */ 347 */
344 // TODO(jmesserly): the term "function member" is a bit weird, but it allows 348 // TODO(jmesserly): the term "function member" is a bit weird, but it allows
345 // a certain consistency. 349 // a certain consistency.
350 @deprecated
346 class FunctionMember extends ExecutableMember implements FunctionElement { 351 class FunctionMember extends ExecutableMember implements FunctionElement {
347 /** 352 /**
348 * Initialize a newly created element to represent a function, based on the 353 * Initialize a newly created element to represent a function, based on the
349 * [baseElement], with the corresponding function [type]. 354 * [baseElement], with the corresponding function [type].
350 */ 355 */
356 @deprecated
351 FunctionMember(FunctionElement baseElement, [DartType type]) 357 FunctionMember(FunctionElement baseElement, [DartType type])
352 : super(baseElement, null, type); 358 : super(baseElement, null, type);
353 359
354 @override 360 @override
355 FunctionElement get baseElement => super.baseElement as FunctionElement; 361 FunctionElement get baseElement => super.baseElement as FunctionElement;
356 362
357 @override 363 @override
358 Element get enclosingElement => baseElement.enclosingElement; 364 Element get enclosingElement => baseElement.enclosingElement;
359 365
360 @override 366 @override
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 } 673 }
668 return ParameterElement.EMPTY_LIST; 674 return ParameterElement.EMPTY_LIST;
669 } 675 }
670 676
671 @override 677 @override
672 List<TypeParameterElement> get typeParameters => baseElement.typeParameters; 678 List<TypeParameterElement> get typeParameters => baseElement.typeParameters;
673 679
674 @override 680 @override
675 SourceRange get visibleRange => baseElement.visibleRange; 681 SourceRange get visibleRange => baseElement.visibleRange;
676 682
677 // TODO(jmesserly): this equality is broken. It should consider the defining
678 // type as well, otherwise we're dropping the substitution.
679 @override
680 bool operator ==(Object object) =>
681 object is ParameterMember && baseElement == object.baseElement;
682
683 @override 683 @override
684 accept(ElementVisitor visitor) => visitor.visitParameterElement(this); 684 accept(ElementVisitor visitor) => visitor.visitParameterElement(this);
685 685
686 @override 686 @override
687 FormalParameter computeNode() => baseElement.computeNode(); 687 FormalParameter computeNode() => baseElement.computeNode();
688 688
689 @override 689 @override
690 Element getAncestor(Predicate<Element> predicate) { 690 Element getAncestor(Predicate<Element> predicate) {
691 Element element = baseElement.getAncestor(predicate); 691 Element element = baseElement.getAncestor(predicate);
692 ParameterizedType definingType = this.definingType; 692 ParameterizedType definingType = this.definingType;
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
959 bool get isStatic => baseElement.isStatic; 959 bool get isStatic => baseElement.isStatic;
960 960
961 @override 961 @override
962 void visitChildren(ElementVisitor visitor) { 962 void visitChildren(ElementVisitor visitor) {
963 // TODO(brianwilkerson) We need to finish implementing the accessors used 963 // TODO(brianwilkerson) We need to finish implementing the accessors used
964 // below so that we can safely invoke them. 964 // below so that we can safely invoke them.
965 super.visitChildren(visitor); 965 super.visitChildren(visitor);
966 safelyVisitChild(baseElement.initializer, visitor); 966 safelyVisitChild(baseElement.initializer, visitor);
967 } 967 }
968 } 968 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/dart/element/type.dart ('k') | pkg/analyzer/lib/src/dart/element/type.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698