OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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/class_finalizer.h" | 5 #include "vm/class_finalizer.h" |
6 | 6 |
7 #include "vm/code_generator.h" | 7 #include "vm/code_generator.h" |
8 #include "vm/flags.h" | 8 #include "vm/flags.h" |
9 #include "vm/heap.h" | 9 #include "vm/heap.h" |
10 #include "vm/isolate.h" | 10 #include "vm/isolate.h" |
(...skipping 1255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1266 Error& error = Error::Handle(); | 1266 Error& error = Error::Handle(); |
1267 for (intptr_t i = 0; i < num_functions; i++) { | 1267 for (intptr_t i = 0; i < num_functions; i++) { |
1268 function ^= array.At(i); | 1268 function ^= array.At(i); |
1269 ResolveAndFinalizeSignature(cls, function); | 1269 ResolveAndFinalizeSignature(cls, function); |
1270 name = function.name(); | 1270 name = function.name(); |
1271 if (FLAG_error_on_bad_override && // Report signature conflicts only. | 1271 if (FLAG_error_on_bad_override && // Report signature conflicts only. |
1272 !function.is_static() && !function.IsConstructor()) { | 1272 !function.is_static() && !function.IsConstructor()) { |
1273 // A constructor cannot override anything. | 1273 // A constructor cannot override anything. |
1274 for (intptr_t i = 0; i < interfaces.Length(); i++) { | 1274 for (intptr_t i = 0; i < interfaces.Length(); i++) { |
1275 super_class ^= interfaces.At(i); | 1275 super_class ^= interfaces.At(i); |
| 1276 // Finalize superclass since overrides check relies on all members |
| 1277 // of the superclass to be finalized. |
| 1278 FinalizeClass(super_class); |
1276 overridden_function = super_class.LookupDynamicFunction(name); | 1279 overridden_function = super_class.LookupDynamicFunction(name); |
1277 if (!overridden_function.IsNull() && | 1280 if (!overridden_function.IsNull() && |
1278 !function.HasCompatibleParametersWith(overridden_function, | 1281 !function.HasCompatibleParametersWith(overridden_function, |
1279 &error)) { | 1282 &error)) { |
1280 const String& class_name = String::Handle(cls.Name()); | 1283 const String& class_name = String::Handle(cls.Name()); |
1281 const String& super_class_name = String::Handle(super_class.Name()); | 1284 const String& super_class_name = String::Handle(super_class.Name()); |
1282 const Script& script = Script::Handle(cls.script()); | 1285 const Script& script = Script::Handle(cls.script()); |
1283 ReportError(error, script, function.token_pos(), | 1286 ReportError(error, script, function.token_pos(), |
1284 "class '%s' overrides method '%s' of super class '%s' " | 1287 "class '%s' overrides method '%s' of super class '%s' " |
1285 "with incompatible parameters", | 1288 "with incompatible parameters", |
(...skipping 1514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2800 expected_name ^= String::New("_offset"); | 2803 expected_name ^= String::New("_offset"); |
2801 ASSERT(String::EqualsIgnoringPrivateKey(name, expected_name)); | 2804 ASSERT(String::EqualsIgnoringPrivateKey(name, expected_name)); |
2802 field ^= fields_array.At(2); | 2805 field ^= fields_array.At(2); |
2803 ASSERT(field.Offset() == TypedDataView::length_offset()); | 2806 ASSERT(field.Offset() == TypedDataView::length_offset()); |
2804 name ^= field.name(); | 2807 name ^= field.name(); |
2805 ASSERT(name.Equals("length")); | 2808 ASSERT(name.Equals("length")); |
2806 #endif | 2809 #endif |
2807 } | 2810 } |
2808 | 2811 |
2809 } // namespace dart | 2812 } // namespace dart |
OLD | NEW |