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

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

Issue 2995813002: fix #30423, covariant parameter tearoff type should be Object (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 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.
7228 @override 7232 @override
7229 FunctionType getReifiedType(DartType objectType) { 7233 FunctionType getReifiedType(DartType objectType) {
Jennifer Messerly 2017/08/12 00:10:49 FYI: I want to remove this, because it's broken, a
Paul Berry 2017/08/14 16:11:47 Sounds good! I suggest you mark it as @deprecated
7230 // Check whether we have any covariant parameters. 7234 // Check whether we have any covariant parameters.
7231 // Usually we don't, so we can use the same type. 7235 // Usually we don't, so we can use the same type.
7232 bool hasCovariant = false; 7236 bool hasCovariant = false;
7233 for (ParameterElement parameter in parameters) { 7237 for (ParameterElement parameter in parameters) {
7234 if (parameter.isCovariant) { 7238 if (parameter.isCovariant) {
7235 hasCovariant = true; 7239 hasCovariant = true;
7236 break; 7240 break;
7237 } 7241 }
7238 } 7242 }
7239 7243
(...skipping 2695 matching lines...) Expand 10 before | Expand all | Expand 10 after
9935 9939
9936 @override 9940 @override
9937 DartObject computeConstantValue() => null; 9941 DartObject computeConstantValue() => null;
9938 9942
9939 @override 9943 @override
9940 void visitChildren(ElementVisitor visitor) { 9944 void visitChildren(ElementVisitor visitor) {
9941 super.visitChildren(visitor); 9945 super.visitChildren(visitor);
9942 _initializer?.accept(visitor); 9946 _initializer?.accept(visitor);
9943 } 9947 }
9944 } 9948 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698