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

Unified Diff: pkg/compiler/lib/src/compile_time_constants.dart

Issue 1423623008: Improve messages and static use for super/this-calls. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comment. Created 5 years, 1 month 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/diagnostics/messages.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 1cc17a99d6c8ff7310c8e0f08bd0d9fcb625f78c..34d9adb675869bcd773bf59db67ca22f536d33cb 100644
--- a/pkg/compiler/lib/src/compile_time_constants.dart
+++ b/pkg/compiler/lib/src/compile_time_constants.dart
@@ -1151,10 +1151,16 @@ class ConstructorEvaluator extends CompileTimeConstantEvaluator {
// A super initializer or constructor redirection.
Send call = link.head;
FunctionElement target = elements[call];
- List<AstConstant> compiledArguments = evaluateArgumentsToConstructor(
- call, elements.getSelector(call).callStructure, call.arguments,
- target, compileArgument: evaluateConstant);
- evaluateSuperOrRedirectSend(compiledArguments, target);
+ if (!target.isMalformed) {
+ List<AstConstant> compiledArguments =
+ evaluateArgumentsToConstructor(
+ call,
+ elements.getSelector(call).callStructure,
+ call.arguments,
+ target,
+ compileArgument: evaluateConstant);
+ evaluateSuperOrRedirectSend(compiledArguments, target);
+ }
foundSuperOrRedirect = true;
} else {
// A field initializer.
« no previous file with comments | « no previous file | pkg/compiler/lib/src/diagnostics/messages.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698