Chromium Code Reviews| Index: dart/sdk/lib/_internal/compiler/implementation/lib/js_rti.dart |
| diff --git a/dart/sdk/lib/_internal/compiler/implementation/lib/js_rti.dart b/dart/sdk/lib/_internal/compiler/implementation/lib/js_rti.dart |
| index fd64f48144278759c59dc44513f79f1dc68821af..c6d5727c0044537c9e3251f3c7965cc8fb5db787 100644 |
| --- a/dart/sdk/lib/_internal/compiler/implementation/lib/js_rti.dart |
| +++ b/dart/sdk/lib/_internal/compiler/implementation/lib/js_rti.dart |
| @@ -21,13 +21,17 @@ getRuntimeTypeArgument(target, substitution, index) { |
| } |
| class TypeImpl implements Type { |
| - final String typeName; |
| - TypeImpl(this.typeName); |
| - toString() => typeName; |
| - int get hashCode => typeName.hashCode; |
| + final String _typeName; |
| + |
| + TypeImpl(this._typeName); |
| + |
| + toString() => _typeName; |
| + |
| + // TODO(ahe): This is a poor hashCode as it collides with its name. |
| + int get hashCode => _typeName.hashCode; |
|
Johnni Winther
2013/05/08 08:22:08
How about multiplying with a constant prime?
ahe
2013/05/08 08:57:43
I thought so as well. Then it occurred to me: how
|
| + |
| bool operator ==(other) { |
| - if (other is !TypeImpl) return false; |
| - return typeName == other.typeName; |
| + return (other is TypeImpl) && _typeName == other._typeName; |
| } |
| } |