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

Unified Diff: pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart

Issue 2894453002: Remove the closures used by TypeInferrerImpl.inferInvocation. (Closed)
Patch Set: Created 3 years, 7 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/front_end/lib/src/fasta/type_inference/type_inferrer.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart
diff --git a/pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart b/pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart
index 45b41b39184a5099257fec64f481f06c1f3488ae..6335454ac8127cafc7cc0fac92f32758febaa414 100644
--- a/pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart
@@ -27,18 +27,7 @@ import 'package:front_end/src/fasta/type_inference/type_schema_elimination.dart'
import 'package:kernel/ast.dart';
import 'package:kernel/type_algebra.dart';
-_ArgumentForEachFunction _forEachArgument(Arguments arguments) {
- return (void callback(String name, Expression expression)) {
- for (var expression in arguments.positional) {
- callback(null, expression);
- }
- for (var namedExpression in arguments.named) {
- callback(namedExpression.name, namedExpression.value);
- }
- };
-}
-
-List<DartType> _getExplicitTypeArguments(Arguments arguments) {
+List<DartType> getExplicitTypeArguments(Arguments arguments) {
if (arguments is KernelArguments) {
return arguments._hasExplicitTypeArguments ? arguments.types : null;
} else {
@@ -49,9 +38,6 @@ List<DartType> _getExplicitTypeArguments(Arguments arguments) {
}
}
-typedef void _ArgumentForEachFunction(
- void callback(String name, Expression expression));
-
/// Concrete shadow object representing a set of invocation arguments.
class KernelArguments extends Arguments {
bool _hasExplicitTypeArguments;
@@ -176,11 +162,7 @@ class KernelConstructorInvocation extends ConstructorInvocation
fileOffset,
target.function.functionType,
target.enclosingClass.thisType,
- _getExplicitTypeArguments(arguments),
- _forEachArgument(arguments), (types) {
- arguments.types.clear();
- arguments.types.addAll(types);
- });
+ arguments);
inferrer.listener.constructorInvocationExit(inferredType);
return inferredType;
}
@@ -688,17 +670,8 @@ class KernelMethodInvocation extends MethodInvocation
}
var calleeType = inferrer.getCalleeFunctionType(
interfaceMember, receiverType, name, fileOffset);
- var inferredType = inferrer.inferInvocation(
- typeContext,
- typeNeeded,
- fileOffset,
- calleeType,
- calleeType.returnType,
- _getExplicitTypeArguments(arguments),
- _forEachArgument(arguments), (types) {
- arguments.types.clear();
- arguments.types.addAll(types);
- },
+ var inferredType = inferrer.inferInvocation(typeContext, typeNeeded,
+ fileOffset, calleeType, calleeType.returnType, arguments,
isOverloadedArithmeticOperator: isOverloadedArithmeticOperator,
receiverType: receiverType);
inferrer.listener.methodInvocationExit(inferredType);
@@ -839,17 +812,8 @@ class KernelStaticInvocation extends StaticInvocation
typeNeeded =
inferrer.listener.staticInvocationEnter(typeContext) || typeNeeded;
var calleeType = target.function.functionType;
- var inferredType = inferrer.inferInvocation(
- typeContext,
- typeNeeded,
- fileOffset,
- calleeType,
- calleeType.returnType,
- _getExplicitTypeArguments(arguments),
- _forEachArgument(arguments), (types) {
- arguments.types.clear();
- arguments.types.addAll(types);
- });
+ var inferredType = inferrer.inferInvocation(typeContext, typeNeeded,
+ fileOffset, calleeType, calleeType.returnType, arguments);
inferrer.listener.staticInvocationExit(inferredType);
return inferredType;
}
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698