Browse Source

added missing key constraint to ObjectMap

Simon Krajewski 12 years ago
parent
commit
f1c4586a81

+ 1 - 1
std/cpp/_std/haxe/ds/ObjectMap.hx

@@ -22,7 +22,7 @@
 package haxe.ds;
 
 @:coreApi
-class ObjectMap<K,V> implements Map.IMap<K,V> {
+class ObjectMap<K:{},V> implements Map.IMap<K,V> {
    // TODO: Might need to add separate hash to keep track of references to keys
 	private var __Internal : IntMap<V>;
 

+ 1 - 1
std/cs/_std/haxe/ds/ObjectMap.hx

@@ -23,7 +23,7 @@ package haxe.ds;
 
 import cs.NativeArray;
 
-@:coreApi class ObjectMap<K, V> implements Map.IMap<K,V>
+@:coreApi class ObjectMap<K:{}, V> implements Map.IMap<K,V>
 {
 	@:extern private static inline var HASH_UPPER = 0.77;
 	@:extern private static inline var FLAG_EMPTY = 0;

+ 2 - 2
std/flash/_std/haxe/ds/ObjectMap.hx

@@ -1,7 +1,7 @@
 package haxe.ds;
 
 @:coreApi
-class ObjectMap<K,V> extends flash.utils.Dictionary implements Map.IMap<K,V> {
+class ObjectMap<K:{},V> extends flash.utils.Dictionary implements Map.IMap<K,V> {
 
 	public function new() {
 		super(false);
@@ -36,7 +36,7 @@ class ObjectMap<K,V> extends flash.utils.Dictionary implements Map.IMap<K,V> {
 		for (i in keys())
 			ret.push(get(i));
 		return ret.iterator();
- 	}	
+ 	}
 	#else
 	
 	public function keys() : Iterator<K> {

+ 1 - 1
std/java/_std/haxe/ds/ObjectMap.hx

@@ -23,7 +23,7 @@ package haxe.ds;
 
 import java.NativeArray;
 
-@:coreApi class ObjectMap<K, V> implements Map.IMap<K,V>
+@:coreApi class ObjectMap<K:{}, V> implements Map.IMap<K,V>
 {
 	@:extern private static inline var HASH_UPPER = 0.77;
 	@:extern private static inline var FLAG_EMPTY = 0;