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

Unified Diff: pkg/compiler/lib/src/universe/call_structure.dart

Issue 2809603002: Introduce ParameterStructure (Closed)
Patch Set: Fix. Created 3 years, 8 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 | « pkg/compiler/lib/src/ssa/builder.dart ('k') | pkg/compiler/lib/src/universe/selector.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/universe/call_structure.dart
diff --git a/pkg/compiler/lib/src/universe/call_structure.dart b/pkg/compiler/lib/src/universe/call_structure.dart
index 8e6c3b9f78fe4605ab4a7e4b810c1ab90297cf0f..e40ceabbf22c22f2081ccf74c0069b3d2e92f52d 100644
--- a/pkg/compiler/lib/src/universe/call_structure.dart
+++ b/pkg/compiler/lib/src/universe/call_structure.dart
@@ -5,7 +5,7 @@
library dart2js.call_structure;
import '../common/names.dart' show Names;
-import '../elements/types.dart' show FunctionType;
+import '../elements/entities.dart' show ParameterStructure;
import '../util/util.dart';
import 'selector.dart' show Selector;
@@ -74,15 +74,14 @@ class CallStructure {
return match(other);
}
- bool signatureApplies(FunctionType type) {
- int requiredParameterCount = type.parameterTypes.length;
- int optionalParameterCount =
- type.optionalParameterTypes.length + type.namedParameters.length;
+ bool signatureApplies(ParameterStructure parameters) {
+ int requiredParameterCount = parameters.requiredParameters;
+ int optionalParameterCount = parameters.optionalParameters;
int parameterCount = requiredParameterCount + optionalParameterCount;
if (argumentCount > parameterCount) return false;
if (positionalArgumentCount < requiredParameterCount) return false;
- if (type.namedParameters.isEmpty) {
+ if (parameters.namedParameters.isEmpty) {
// We have already checked that the number of arguments are
// not greater than the number of parameters. Therefore the
// number of positional arguments are not greater than the
@@ -95,7 +94,7 @@ class CallStructure {
if (namedArgumentCount > optionalParameterCount) return false;
int nameIndex = 0;
- List<String> namedParameters = type.namedParameters;
+ List<String> namedParameters = parameters.namedParameters;
for (String name in getOrderedNamedArguments()) {
bool found = false;
// Note: we start at the existing index because arguments are sorted.
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder.dart ('k') | pkg/compiler/lib/src/universe/selector.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698