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

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

Issue 2997333002: Deprecate MethodElement.getReifiedType (Closed)
Patch Set: Created 3 years, 4 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
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.element; 5 library analyzer.src.dart.element.element;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 import 'dart:math' show min; 8 import 'dart:math' show min;
9 9
10 import 'package:analyzer/dart/ast/ast.dart'; 10 import 'package:analyzer/dart/ast/ast.dart';
(...skipping 7204 matching lines...) Expand 10 before | Expand all | Expand 10 after
7215 @override 7215 @override
7216 void appendTo(StringBuffer buffer) { 7216 void appendTo(StringBuffer buffer) {
7217 buffer.write(displayName); 7217 buffer.write(displayName);
7218 super.appendTo(buffer); 7218 super.appendTo(buffer);
7219 } 7219 }
7220 7220
7221 @override 7221 @override
7222 MethodDeclaration computeNode() => 7222 MethodDeclaration computeNode() =>
7223 getNodeMatching((node) => node is MethodDeclaration); 7223 getNodeMatching((node) => node is MethodDeclaration);
7224 7224
7225 // TODO(jmesserly): this implementation is completely wrong: 7225 @deprecated
7226 // It does not handle covariant parameters from a generic class.
7227 // It drops type parameters from generic methods.
7228 // Since this method was for DDC, it should be removed.
7229 @override 7226 @override
7230 FunctionType getReifiedType(DartType objectType) { 7227 FunctionType getReifiedType(DartType objectType) {
7228 // TODO(jmesserly): this implementation is completely wrong:
7229 // It does not handle covariant parameters from a generic class.
7230 // It drops type parameters from generic methods.
7231 // Since this method was for DDC, it should be removed.
7232 //
7231 // Check whether we have any covariant parameters. 7233 // Check whether we have any covariant parameters.
7232 // Usually we don't, so we can use the same type. 7234 // Usually we don't, so we can use the same type.
7233 bool hasCovariant = false; 7235 bool hasCovariant = false;
7234 for (ParameterElement parameter in parameters) { 7236 for (ParameterElement parameter in parameters) {
7235 if (parameter.isCovariant) { 7237 if (parameter.isCovariant) {
7236 hasCovariant = true; 7238 hasCovariant = true;
7237 break; 7239 break;
7238 } 7240 }
7239 } 7241 }
7240 7242
(...skipping 2695 matching lines...) Expand 10 before | Expand all | Expand 10 after
9936 9938
9937 @override 9939 @override
9938 DartObject computeConstantValue() => null; 9940 DartObject computeConstantValue() => null;
9939 9941
9940 @override 9942 @override
9941 void visitChildren(ElementVisitor visitor) { 9943 void visitChildren(ElementVisitor visitor) {
9942 super.visitChildren(visitor); 9944 super.visitChildren(visitor);
9943 _initializer?.accept(visitor); 9945 _initializer?.accept(visitor);
9944 } 9946 }
9945 } 9947 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/dart/element/element.dart ('k') | pkg/analyzer/lib/src/dart/element/handle.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698