| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 "lib/error.h" | 5 #include "lib/error.h" |
| 6 | 6 |
| 7 #include "vm/bootstrap_natives.h" | 7 #include "vm/bootstrap_natives.h" |
| 8 #include "vm/exceptions.h" | 8 #include "vm/exceptions.h" |
| 9 #include "vm/object_store.h" | 9 #include "vm/object_store.h" |
| 10 #include "vm/runtime_entry.h" | 10 #include "vm/runtime_entry.h" |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 const AbstractType& instantiated_dst_type = AbstractType::Handle( | 265 const AbstractType& instantiated_dst_type = AbstractType::Handle( |
| 266 dst_type.InstantiateFrom(dst_type_instantiator)); | 266 dst_type.InstantiateFrom(dst_type_instantiator)); |
| 267 OS::Print("TypeCheck: '%s' %s assignable to '%s' of '%s' " | 267 OS::Print("TypeCheck: '%s' %s assignable to '%s' of '%s' " |
| 268 "instantiated from '%s'.\n", | 268 "instantiated from '%s'.\n", |
| 269 String::Handle(src_type.Name()).ToCString(), | 269 String::Handle(src_type.Name()).ToCString(), |
| 270 is_assignable ? "is" : "is not", | 270 is_assignable ? "is" : "is not", |
| 271 String::Handle(instantiated_dst_type.Name()).ToCString(), | 271 String::Handle(instantiated_dst_type.Name()).ToCString(), |
| 272 dst_name.ToCString(), | 272 dst_name.ToCString(), |
| 273 String::Handle(dst_type.Name()).ToCString()); | 273 String::Handle(dst_type.Name()).ToCString()); |
| 274 } | 274 } |
| 275 DartFrameIterator iterator; |
| 276 DartFrame* caller_frame = iterator.NextFrame(); |
| 277 ASSERT(caller_frame != NULL); |
| 278 const Function& function = Function::Handle( |
| 279 caller_frame->LookupDartFunction()); |
| 280 OS::Print(" -> Function %s\n", function.ToFullyQualifiedCString()); |
| 275 } | 281 } |
| 276 if (!is_assignable) { | 282 if (!is_assignable) { |
| 277 const Type& src_type = Type::Handle(src_instance.GetType()); | 283 const Type& src_type = Type::Handle(src_instance.GetType()); |
| 278 const String& src_type_name = String::Handle(src_type.Name()); | 284 const String& src_type_name = String::Handle(src_type.Name()); |
| 279 String& dst_type_name = String::Handle(); | 285 String& dst_type_name = String::Handle(); |
| 280 if (!dst_type.IsInstantiated()) { | 286 if (!dst_type.IsInstantiated()) { |
| 281 // Instantiate dst_type before reporting the error. | 287 // Instantiate dst_type before reporting the error. |
| 282 const AbstractType& instantiated_dst_type = AbstractType::Handle( | 288 const AbstractType& instantiated_dst_type = AbstractType::Handle( |
| 283 dst_type.InstantiateFrom(dst_type_instantiator)); | 289 dst_type.InstantiateFrom(dst_type_instantiator)); |
| 284 dst_type_name = instantiated_dst_type.Name(); | 290 dst_type_name = instantiated_dst_type.Name(); |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 dst_type_name = element_type.Name(); | 361 dst_type_name = element_type.Name(); |
| 356 } | 362 } |
| 357 const String& dst_name = String::Handle(String::New(buf)); | 363 const String& dst_name = String::Handle(String::New(buf)); |
| 358 ThrowTypeError(location, src_type_name, dst_type_name, dst_name); | 364 ThrowTypeError(location, src_type_name, dst_type_name, dst_name); |
| 359 UNREACHABLE(); | 365 UNREACHABLE(); |
| 360 } | 366 } |
| 361 } | 367 } |
| 362 } | 368 } |
| 363 | 369 |
| 364 } // namespace dart | 370 } // namespace dart |
| OLD | NEW |