Skip to content

Commit

Permalink
move up ClassMap to avoid UtilsObjectMap taking over precedence
Browse files Browse the repository at this point in the history
  • Loading branch information
Neu2o committed Oct 22, 2020
1 parent aa9dd5b commit b6647c2
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/openfl/utils/Dictionary.hx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ abstract Dictionary<K, V>(IMap<K, V>) {
return new EnumValueMap<K, V>();
}

@:to static function toClassMap<K:Class<Dynamic>, V>(t:IMap<K, V>, weakKeys:Bool):ClassMap<K, V> {
return new ClassMap<K, V>();
}

@:to static function toObjectMap<K:{}, V>(t:IMap<K, V>, weakKeys:Bool):ObjectMap<K, V> {
return new ObjectMap<K, V>();
}
Expand All @@ -65,10 +69,6 @@ abstract Dictionary<K, V>(IMap<K, V>) {
return new UtilsObjectMap<K, V>();
}

@:to static function toClassMap<K:Class<Dynamic>, V>(t:IMap<K, V>, weakKeys:Bool):ClassMap<K, V> {
return new ClassMap<K, V>();
}

@:from static inline function fromStringMap<V>(map:StringMap<V>):Dictionary<String, V> {
return cast map;
}
Expand All @@ -81,15 +81,15 @@ abstract Dictionary<K, V>(IMap<K, V>) {
return cast map;
}

@:from static inline function fromObjectMap<K:{}, V>(map:ObjectMap<K, V>):Dictionary<K, V> {
@:from static inline function fromClassMap<K:Class<Dynamic>, V>(map:ClassMap<K, V>):Dictionary<K, V> {
return cast map;
}

@:from static inline function fromUtilsObjectMap<K:Object, V>(map:UtilsObjectMap<K, V>):Dictionary<K, V> {
@:from static inline function fromObjectMap<K:{}, V>(map:ObjectMap<K, V>):Dictionary<K, V> {
return cast map;
}

@:from static inline function fromClassMap<K:Class<Dynamic>, V>(map:ClassMap<K, V>):Dictionary<K, V> {
@:from static inline function fromUtilsObjectMap<K:Object, V>(map:UtilsObjectMap<K, V>):Dictionary<K, V> {
return cast map;
}
}
Expand Down

0 comments on commit b6647c2

Please sign in to comment.