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

Unified Diff: pkg/compiler/lib/src/compile_time_constants.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 | « no previous file | pkg/compiler/lib/src/resolution/constructors.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/compile_time_constants.dart
diff --git a/pkg/compiler/lib/src/compile_time_constants.dart b/pkg/compiler/lib/src/compile_time_constants.dart
index b0c750267c7e3cb0fce9e5557088d6de2625e94b..4b0be2dd57e82be760717401281eaf4ed4efc4c2 100644
--- a/pkg/compiler/lib/src/compile_time_constants.dart
+++ b/pkg/compiler/lib/src/compile_time_constants.dart
@@ -779,7 +779,7 @@ class CompileTimeConstantEvaluator extends Visitor<AstConstant> {
Node node,
CallStructure callStructure,
Link<Node> arguments,
- FunctionElement target,
+ ConstructorElement target,
{AstConstant compileArgument(Node node)}) {
assert(invariant(node, target.isImplementation));
@@ -790,7 +790,8 @@ class CompileTimeConstantEvaluator extends Visitor<AstConstant> {
}
target.computeType(compiler);
- if (!callStructure.signatureApplies(target)) {
+ FunctionSignature signature = target.functionSignature;
+ if (!callStructure.signatureApplies(signature)) {
String name = Elements.constructorNameForDiagnostics(
target.enclosingClass.name, target.name);
compiler.reportError(
@@ -1028,8 +1029,10 @@ class CompileTimeConstantEvaluator extends Visitor<AstConstant> {
"effective target: $constructor"));
return new ErroneousAstConstant(context, node);
}
- assert(invariant(node, callStructure.signatureApplies(constructor) ||
- compiler.compilationFailed,
+ assert(invariant(
+ node,
+ callStructure.signatureApplies(constructor.functionSignature) ||
+ compiler.compilationFailed,
message: "Call structure $callStructure does not apply to constructor "
"$constructor."));
« no previous file with comments | « no previous file | pkg/compiler/lib/src/resolution/constructors.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698