Chromium Code Reviews| Index: runtime/vm/object.cc |
| =================================================================== |
| --- runtime/vm/object.cc (revision 6912) |
| +++ runtime/vm/object.cc (working copy) |
| @@ -2739,6 +2739,32 @@ |
| } |
| +bool InstantiatedType::Equals(const AbstractType& other) const { |
| + if (raw() == other.raw()) { |
| + return true; |
| + } |
| + if (!other.IsInstantiatedType()) { |
| + return false; |
| + } |
| + InstantiatedType& other_instantiated = InstantiatedType::Handle(); |
| + other_instantiated ^= other.raw(); |
| + if (IsFinalized() != other_instantiated.IsFinalized()) { |
|
regis
2012/04/25 01:53:53
I do not think this is necessary. An InstantiatedT
srdjan
2012/04/25 16:38:01
Is is used for canonicalization. Will try to do it
|
| + return false; |
| + } |
| + const AbstractType& this_type = AbstractType::Handle(uninstantiated_type()); |
| + const AbstractType& other_type = |
| + AbstractType::Handle(other_instantiated.uninstantiated_type()); |
| + if (!this_type.Equals(other_type)) { |
| + return false; |
| + } |
| + if (instantiator_type_arguments() != |
|
regis
2012/04/25 01:53:53
Using != is not correct. You should be using Equal
srdjan
2012/04/25 16:38:01
Using AreEqual.
|
| + other_instantiated.instantiator_type_arguments()) { |
| + return false; |
| + } |
| + return true; |
| +} |
| + |
| + |
| const char* InstantiatedType::ToCString() const { |
| return "InstantiatedType"; |
| } |