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

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

Issue 2995973002: Gardening: Revert "fix #30423, covariant parameter tearoff type should be Object" (TBR) (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
« no previous file with comments | « no previous file | pkg/dev_compiler/lib/src/compiler/code_generator.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.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 7207 matching lines...) Expand 10 before | Expand all | Expand 10 after
7218 @override 7218 @override
7219 void appendTo(StringBuffer buffer) { 7219 void appendTo(StringBuffer buffer) {
7220 buffer.write(displayName); 7220 buffer.write(displayName);
7221 super.appendTo(buffer); 7221 super.appendTo(buffer);
7222 } 7222 }
7223 7223
7224 @override 7224 @override
7225 MethodDeclaration computeNode() => 7225 MethodDeclaration computeNode() =>
7226 getNodeMatching((node) => node is MethodDeclaration); 7226 getNodeMatching((node) => node is MethodDeclaration);
7227 7227
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 @override 7228 @override
7233 FunctionType getReifiedType(DartType objectType) { 7229 FunctionType getReifiedType(DartType objectType) {
7234 // Check whether we have any covariant parameters. 7230 // Check whether we have any covariant parameters.
7235 // Usually we don't, so we can use the same type. 7231 // Usually we don't, so we can use the same type.
7236 bool hasCovariant = false; 7232 bool hasCovariant = false;
7237 for (ParameterElement parameter in parameters) { 7233 for (ParameterElement parameter in parameters) {
7238 if (parameter.isCovariant) { 7234 if (parameter.isCovariant) {
7239 hasCovariant = true; 7235 hasCovariant = true;
7240 break; 7236 break;
7241 } 7237 }
(...skipping 2697 matching lines...) Expand 10 before | Expand all | Expand 10 after
9939 9935
9940 @override 9936 @override
9941 DartObject computeConstantValue() => null; 9937 DartObject computeConstantValue() => null;
9942 9938
9943 @override 9939 @override
9944 void visitChildren(ElementVisitor visitor) { 9940 void visitChildren(ElementVisitor visitor) {
9945 super.visitChildren(visitor); 9941 super.visitChildren(visitor);
9946 _initializer?.accept(visitor); 9942 _initializer?.accept(visitor);
9947 } 9943 }
9948 } 9944 }
OLDNEW
« no previous file with comments | « no previous file | pkg/dev_compiler/lib/src/compiler/code_generator.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698