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

Unified Diff: pkg/analyzer/lib/src/dart/element/member.dart

Issue 2378243004: fix #27454, prune FunctionTypeImpl.parameters (Closed)
Patch Set: fix null type Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/dart/element/type.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/dart/element/member.dart
diff --git a/pkg/analyzer/lib/src/dart/element/member.dart b/pkg/analyzer/lib/src/dart/element/member.dart
index 29b347fdc8b39d1a41f9776073f94c3002bcb828..d498728b9ef73c41cd2ad500978ebe1d6d45a03e 100644
--- a/pkg/analyzer/lib/src/dart/element/member.dart
+++ b/pkg/analyzer/lib/src/dart/element/member.dart
@@ -742,34 +742,6 @@ class ParameterMember extends VariableMember
super.visitChildren(visitor);
safelyVisitChildren(parameters, visitor);
}
-
- /**
- * If the given [parameter]'s type is different when any type parameters from
- * the defining type's declaration are replaced with the actual type
- * arguments from the [definingType], create a parameter member representing
- * the given parameter. Return the member that was created, or the base
- * parameter if no member was created.
- */
- static ParameterElement from(
- ParameterElement parameter, ParameterizedType definingType) {
- if (parameter == null || definingType.typeArguments.length == 0) {
- return parameter;
- }
- // Check if parameter type depends on defining type type arguments.
- // It is possible that we did not resolve field formal parameter yet,
- // so skip this check for it.
- if (parameter is FieldFormalParameterElement) {
- return new FieldFormalParameterMember(parameter, definingType);
- } else {
- DartType baseType = parameter.type;
- List<DartType> argumentTypes = definingType.typeArguments;
- List<DartType> parameterTypes =
- TypeParameterTypeImpl.getTypes(definingType.typeParameters);
- DartType substitutedType =
- baseType.substitute2(argumentTypes, parameterTypes);
- return new ParameterMember(parameter, definingType, substitutedType);
- }
- }
}
/**
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/dart/element/type.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698