| 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 "vm/bigint_operations.h" | 7 #include "vm/bigint_operations.h" |
| 8 #include "vm/class_finalizer.h" | 8 #include "vm/class_finalizer.h" |
| 9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
| 10 #include "vm/compiler_stats.h" | 10 #include "vm/compiler_stats.h" |
| (...skipping 2786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2797 Array::Handle(factory_class.type_parameters()); | 2797 Array::Handle(factory_class.type_parameters()); |
| 2798 const intptr_t num_type_params = factory_class.NumTypeParameters(); | 2798 const intptr_t num_type_params = factory_class.NumTypeParameters(); |
| 2799 bool mismatch = interface.NumTypeParameters() != num_type_params; | 2799 bool mismatch = interface.NumTypeParameters() != num_type_params; |
| 2800 for (intptr_t i = 0; !mismatch && (i < num_type_params); i++) { | 2800 for (intptr_t i = 0; !mismatch && (i < num_type_params); i++) { |
| 2801 interface_type_param_name ^= interface_type_param_names.At(i); | 2801 interface_type_param_name ^= interface_type_param_names.At(i); |
| 2802 factory_type_param_name ^= factory_type_param_names.At(i); | 2802 factory_type_param_name ^= factory_type_param_names.At(i); |
| 2803 if (!interface_type_param_name.Equals(factory_type_param_name)) { | 2803 if (!interface_type_param_name.Equals(factory_type_param_name)) { |
| 2804 mismatch = true; | 2804 mismatch = true; |
| 2805 } | 2805 } |
| 2806 } | 2806 } |
| 2807 if (mismatch) { | 2807 // The list of type parameters in the default factory clause can be omitted. |
| 2808 if (mismatch && (num_type_params > 0)) { |
| 2808 const String& interface_name = String::Handle(interface.Name()); | 2809 const String& interface_name = String::Handle(interface.Name()); |
| 2809 const String& factory_name = String::Handle(factory_class.Name()); | 2810 const String& factory_name = String::Handle(factory_class.Name()); |
| 2810 ErrorMsg(factory_pos, | 2811 ErrorMsg(factory_pos, |
| 2811 "mismatch in number or names of type parameters between " | 2812 "mismatch in number or names of type parameters between " |
| 2812 "interface '%s' and default factory class '%s'.\n", | 2813 "interface '%s' and default factory class '%s'.\n", |
| 2813 interface_name.ToCString(), | 2814 interface_name.ToCString(), |
| 2814 factory_name.ToCString()); | 2815 factory_name.ToCString()); |
| 2815 } | 2816 } |
| 2816 } | 2817 } |
| 2817 | 2818 |
| (...skipping 4882 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7700 void Parser::SkipQualIdent() { | 7701 void Parser::SkipQualIdent() { |
| 7701 ASSERT(IsIdentifier()); | 7702 ASSERT(IsIdentifier()); |
| 7702 ConsumeToken(); | 7703 ConsumeToken(); |
| 7703 if (CurrentToken() == Token::kPERIOD) { | 7704 if (CurrentToken() == Token::kPERIOD) { |
| 7704 ConsumeToken(); // Consume the kPERIOD token. | 7705 ConsumeToken(); // Consume the kPERIOD token. |
| 7705 ExpectIdentifier("identifier expected after '.'"); | 7706 ExpectIdentifier("identifier expected after '.'"); |
| 7706 } | 7707 } |
| 7707 } | 7708 } |
| 7708 | 7709 |
| 7709 } // namespace dart | 7710 } // namespace dart |
| OLD | NEW |