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

Side by Side Diff: runtime/vm/parser.cc

Issue 2248943002: Class fields cannot be declared to be of type void (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: wip Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | tests/language/syntax_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/parser.h" 5 #include "vm/parser.h"
6 #include "vm/flags.h" 6 #include "vm/flags.h"
7 7
8 #ifndef DART_PRECOMPILED_RUNTIME 8 #ifndef DART_PRECOMPILED_RUNTIME
9 9
10 #include "lib/invocation_mirror.h" 10 #include "lib/invocation_mirror.h"
(...skipping 4477 matching lines...) Expand 10 before | Expand all | Expand 10 after
4488 // const fields are implicitly final. 4488 // const fields are implicitly final.
4489 member.has_final = true; 4489 member.has_final = true;
4490 } 4490 }
4491 if (member.type == NULL) { 4491 if (member.type == NULL) {
4492 if (member.has_final) { 4492 if (member.has_final) {
4493 member.type = &Object::dynamic_type(); 4493 member.type = &Object::dynamic_type();
4494 } else { 4494 } else {
4495 ReportError("missing 'var', 'final', 'const' or type" 4495 ReportError("missing 'var', 'final', 'const' or type"
4496 " in field declaration"); 4496 " in field declaration");
4497 } 4497 }
4498 } else if (member.type->IsVoidType()) {
4499 ReportError(member.name_pos, "field may not be 'void'");
rmacnak 2016/08/15 23:55:58 Would be nice if top level fields gave the same er
4498 } 4500 }
4499 ParseFieldDefinition(members, &member); 4501 ParseFieldDefinition(members, &member);
4500 } else { 4502 } else {
4501 UnexpectedToken(); 4503 UnexpectedToken();
4502 } 4504 }
4503 current_member_ = NULL; 4505 current_member_ = NULL;
4504 CheckMemberNameConflict(members, &member); 4506 CheckMemberNameConflict(members, &member);
4505 members->AddMember(member); 4507 members->AddMember(member);
4506 } 4508 }
4507 4509
(...skipping 10273 matching lines...) Expand 10 before | Expand all | Expand 10 after
14781 const ArgumentListNode& function_args, 14783 const ArgumentListNode& function_args,
14782 const LocalVariable* temp_for_last_arg, 14784 const LocalVariable* temp_for_last_arg,
14783 bool is_super_invocation) { 14785 bool is_super_invocation) {
14784 UNREACHABLE(); 14786 UNREACHABLE();
14785 return NULL; 14787 return NULL;
14786 } 14788 }
14787 14789
14788 } // namespace dart 14790 } // namespace dart
14789 14791
14790 #endif // DART_PRECOMPILED_RUNTIME 14792 #endif // DART_PRECOMPILED_RUNTIME
OLDNEW
« no previous file with comments | « no previous file | tests/language/syntax_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698