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

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

Issue 2916453003: Fix VM to accept literal function type as type bound (fixes #29481). (Closed)
Patch Set: void alone as bound is not accepted Created 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | tests/language/language_analyzer2.status » ('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 5608 matching lines...) Expand 10 before | Expand all | Expand 10 after
5619 } 5619 }
5620 } 5620 }
5621 if ((CurrentToken() == Token::kEXTENDS) || 5621 if ((CurrentToken() == Token::kEXTENDS) ||
5622 (!parameterizing_class && (CurrentToken() == Token::kSUPER))) { 5622 (!parameterizing_class && (CurrentToken() == Token::kSUPER))) {
5623 const bool is_lower_bound = CurrentToken() == Token::kSUPER; 5623 const bool is_lower_bound = CurrentToken() == Token::kSUPER;
5624 ConsumeToken(); 5624 ConsumeToken();
5625 // A bound may refer to the owner of the type parameter it applies to, 5625 // A bound may refer to the owner of the type parameter it applies to,
5626 // i.e. to the class or function currently being parsed. 5626 // i.e. to the class or function currently being parsed.
5627 // Postpone resolution in order to avoid resolving the owner and its 5627 // Postpone resolution in order to avoid resolving the owner and its
5628 // type parameters, as they are not fully parsed yet. 5628 // type parameters, as they are not fully parsed yet.
5629 type_parameter_bound = ParseType(ClassFinalizer::kDoNotResolve); 5629 type_parameter_bound =
5630 ParseTypeOrFunctionType(false, ClassFinalizer::kDoNotResolve);
5630 if (is_lower_bound) { 5631 if (is_lower_bound) {
5631 // TODO(regis): Handle 'super' differently than 'extends' if lower 5632 // TODO(regis): Handle 'super' differently than 'extends' if lower
5632 // bounds make it in the final specification and if run time support 5633 // bounds make it in the final specification and if run time support
5633 // for lower bounds is required. 5634 // for lower bounds is required.
5634 // For now, we parse but ignore lower bounds and only support upper 5635 // For now, we parse but ignore lower bounds and only support upper
5635 // bounds. 5636 // bounds.
5636 type_parameter_bound = I->object_store()->object_type(); 5637 type_parameter_bound = I->object_store()->object_type();
5637 } 5638 }
5638 } else { 5639 } else {
5639 type_parameter_bound = I->object_store()->object_type(); 5640 type_parameter_bound = I->object_store()->object_type();
(...skipping 9673 matching lines...) Expand 10 before | Expand all | Expand 10 after
15313 TokenPosition* start, 15314 TokenPosition* start,
15314 TokenPosition* end) { 15315 TokenPosition* end) {
15315 UNREACHABLE(); 15316 UNREACHABLE();
15316 return false; 15317 return false;
15317 } 15318 }
15318 15319
15319 15320
15320 } // namespace dart 15321 } // namespace dart
15321 15322
15322 #endif // DART_PRECOMPILED_RUNTIME 15323 #endif // DART_PRECOMPILED_RUNTIME
OLDNEW
« no previous file with comments | « no previous file | tests/language/language_analyzer2.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698