| OLD | NEW |
| 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 | 6 |
| 7 #include "lib/invocation_mirror.h" | 7 #include "lib/invocation_mirror.h" |
| 8 #include "vm/bigint_operations.h" | 8 #include "vm/bigint_operations.h" |
| 9 #include "vm/bootstrap.h" | 9 #include "vm/bootstrap.h" |
| 10 #include "vm/class_finalizer.h" | 10 #include "vm/class_finalizer.h" |
| (...skipping 3787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3798 // We do not check that the bounds are repeated. We use the original ones. | 3798 // We do not check that the bounds are repeated. We use the original ones. |
| 3799 // TODO(regis): Should we check? | 3799 // TODO(regis): Should we check? |
| 3800 } | 3800 } |
| 3801 cls.set_type_parameters(orig_type_parameters); | 3801 cls.set_type_parameters(orig_type_parameters); |
| 3802 } | 3802 } |
| 3803 AbstractType& super_type = Type::Handle(); | 3803 AbstractType& super_type = Type::Handle(); |
| 3804 if (CurrentToken() == Token::kEXTENDS) { | 3804 if (CurrentToken() == Token::kEXTENDS) { |
| 3805 ConsumeToken(); | 3805 ConsumeToken(); |
| 3806 const intptr_t type_pos = TokenPos(); | 3806 const intptr_t type_pos = TokenPos(); |
| 3807 super_type = ParseType(ClassFinalizer::kResolveTypeParameters); | 3807 super_type = ParseType(ClassFinalizer::kResolveTypeParameters); |
| 3808 if (super_type.IsDynamicType()) { |
| 3809 // The string 'dynamic' is not resolved yet at this point, but a malformed |
| 3810 // type mapped to dynamic can be encountered here. |
| 3811 ErrorMsg(type_pos, |
| 3812 "class '%s' may not extend a malformed type", |
| 3813 class_name.ToCString()); |
| 3814 } |
| 3808 if (super_type.IsTypeParameter()) { | 3815 if (super_type.IsTypeParameter()) { |
| 3809 ErrorMsg(type_pos, | 3816 ErrorMsg(type_pos, |
| 3810 "class '%s' may not extend type parameter '%s'", | 3817 "class '%s' may not extend type parameter '%s'", |
| 3811 class_name.ToCString(), | 3818 class_name.ToCString(), |
| 3812 String::Handle(super_type.UserVisibleName()).ToCString()); | 3819 String::Handle(super_type.UserVisibleName()).ToCString()); |
| 3813 } | 3820 } |
| 3814 if (CurrentToken() == Token::kWITH) { | 3821 if (CurrentToken() == Token::kWITH) { |
| 3815 super_type = ParseMixins(pending_classes, super_type); | 3822 super_type = ParseMixins(pending_classes, super_type); |
| 3816 } | 3823 } |
| 3817 } else { | 3824 } else { |
| (...skipping 6805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10623 void Parser::SkipQualIdent() { | 10630 void Parser::SkipQualIdent() { |
| 10624 ASSERT(IsIdentifier()); | 10631 ASSERT(IsIdentifier()); |
| 10625 ConsumeToken(); | 10632 ConsumeToken(); |
| 10626 if (CurrentToken() == Token::kPERIOD) { | 10633 if (CurrentToken() == Token::kPERIOD) { |
| 10627 ConsumeToken(); // Consume the kPERIOD token. | 10634 ConsumeToken(); // Consume the kPERIOD token. |
| 10628 ExpectIdentifier("identifier expected after '.'"); | 10635 ExpectIdentifier("identifier expected after '.'"); |
| 10629 } | 10636 } |
| 10630 } | 10637 } |
| 10631 | 10638 |
| 10632 } // namespace dart | 10639 } // namespace dart |
| OLD | NEW |