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

Unified Diff: sdk/lib/_internal/compiler/implementation/resolution/members.dart

Issue 107103007: Emit a compile-time error for initializers of the form this.foo and super.foo. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years 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
Index: sdk/lib/_internal/compiler/implementation/resolution/members.dart
diff --git a/sdk/lib/_internal/compiler/implementation/resolution/members.dart b/sdk/lib/_internal/compiler/implementation/resolution/members.dart
index 9f5857677002adff23d2aa1312d84a79e8133135..d2da1c59a7723a6c96c62ae5bb8d5f0894597915 100644
--- a/sdk/lib/_internal/compiler/implementation/resolution/members.dart
+++ b/sdk/lib/_internal/compiler/implementation/resolution/members.dart
@@ -1468,14 +1468,16 @@ class InitializerResolver {
}
FunctionElement result;
bool resolvedSuper = false;
- for (Link<Node> link = initializers;
- !link.isEmpty;
- link = link.tail) {
+ for (Link<Node> link = initializers; !link.isEmpty; link = link.tail) {
if (link.head.asSendSet() != null) {
final SendSet init = link.head.asSendSet();
resolveFieldInitializer(constructor, init);
} else if (link.head.asSend() != null) {
final Send call = link.head.asSend();
+ if (call.argumentsNode == null) {
+ error(link.head, MessageKind.INVALID_INITIALIZER);
+ continue;
+ }
if (Initializers.isSuperConstructorCall(call)) {
if (resolvedSuper) {
error(call, MessageKind.DUPLICATE_SUPER_INITIALIZER);
« no previous file with comments | « no previous file | tests/language/illegal_initializer_test.dart » ('j') | tests/language/illegal_initializer_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698