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

Unified Diff: pkg/compiler/lib/src/ssa/builder.dart

Issue 1213833002: Use a FunctionSignature in CallStructure.signatureApplies (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 5 years, 6 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/resolution/send_resolver.dart ('k') | pkg/compiler/lib/src/universe/universe.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/ssa/builder.dart
diff --git a/pkg/compiler/lib/src/ssa/builder.dart b/pkg/compiler/lib/src/ssa/builder.dart
index 4c3a91838812ec472b8026ddb272f8afd5cdf984..6caccff4ab7844da73b9df2aa0739a8ddef1e3f5 100644
--- a/pkg/compiler/lib/src/ssa/builder.dart
+++ b/pkg/compiler/lib/src/ssa/builder.dart
@@ -1959,12 +1959,13 @@ class SsaBuilder extends ast.Visitor
}
Element target = constructor.definingConstructor.implementation;
- bool match = CallStructure.addForwardingElementArgumentsToList(
- constructor,
- arguments,
- target,
- compileArgument,
- handleConstantForOptionalParameter);
+ bool match = !target.isErroneous &&
+ CallStructure.addForwardingElementArgumentsToList(
+ constructor,
+ arguments,
+ target,
+ compileArgument,
+ handleConstantForOptionalParameter);
if (!match) {
if (compiler.elementHasCompileTimeError(constructor)) {
return;
@@ -4886,13 +4887,16 @@ class SsaBuilder extends ast.Visitor
}
// TODO(5347): Try to avoid the need for calling [implementation] before
// calling [makeStaticArgumentList].
- if (!callStructure.signatureApplies(constructor.implementation)) {
+ constructorImplementation = constructor.implementation;
+ if (constructorImplementation.isErroneous ||
+ !callStructure.signatureApplies(
+ constructorImplementation.functionSignature)) {
generateWrongArgumentCountError(send, constructor, send.arguments);
return;
}
inputs.addAll(makeStaticArgumentList(callStructure,
send.arguments,
- constructor.implementation));
+ constructorImplementation));
TypeMask elementType = computeType(constructor);
if (isFixedListConstructorCall) {
« no previous file with comments | « pkg/compiler/lib/src/resolution/send_resolver.dart ('k') | pkg/compiler/lib/src/universe/universe.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698