Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bring back class map #205

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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