Chromium Code Reviews| Index: runtime/vm/object.cc |
| =================================================================== |
| --- runtime/vm/object.cc (revision 9203) |
| +++ runtime/vm/object.cc (working copy) |
| @@ -2442,9 +2442,7 @@ |
| // a class B<T> will never require a run time bounds check, even it T is |
| // uninstantiated at compile time. |
| if (IsTypeParameter()) { |
| - // TODO(regis): Introduce and use TypeParameter::Cast(). |
| - const TypeParameter* type_param = |
| - reinterpret_cast<const TypeParameter*>(this); |
| + const TypeParameter* type_param = TypeParameter::Cast(*this); |
|
Ivan Posva
2012/06/28 16:35:09
I am wondering if we will need a
static const ob
regis
2012/06/28 18:44:51
Isn't it exactly what we have? That is, before I c
|
| if (other.IsTypeParameter()) { |
| const TypeParameter* other_type_param = |
| reinterpret_cast<const TypeParameter*>(&other); |
| @@ -3313,8 +3311,7 @@ |
| if (!type.IsTypeParameter()) { |
| return false; |
| } |
| - // TODO(regis): Introduce and use TypeParameter::Cast(). |
| - TypeParameter* type_param = reinterpret_cast<TypeParameter*>(&type); |
| + const TypeParameter* type_param = TypeParameter::Cast(type); |
| if ((type_param->index() != i)) { |
|
siva
2012/06/28 17:02:51
For example this would be
const TypeParameter& typ
regis
2012/06/28 18:44:51
Done.
|
| return false; |
| } |
| @@ -7216,9 +7213,7 @@ |
| if (other_instantiator.IsNull()) { |
| return true; // Other type is uninstantiated, i.e. Dynamic. |
| } |
| - // TODO(regis): Introduce and use TypeParameter::Cast(). |
| - const TypeParameter* other_type_param = |
| - reinterpret_cast<const TypeParameter*>(&other); |
| + const TypeParameter* other_type_param = TypeParameter::Cast(other); |
| const AbstractType& instantiated_other = AbstractType::Handle( |
| other_instantiator.TypeAt(other_type_param->index())); |
| ASSERT(instantiated_other.IsInstantiated()); |