WIP: reorganization of keypath utilities (in prep for @propertyWrappers)

This commit is contained in:
John Estropia
2019-07-09 14:50:23 +09:00
parent 67bb9340c7
commit ed3d21db77
14 changed files with 523 additions and 314 deletions

View File

@@ -265,7 +265,7 @@ extension OrderBy.SortKey where D: CoreStoreObject {
/**
Indicates that the `KeyPathString` should be sorted in ascending order
*/
public static func ascending<K: DynamicKeyPath>(_ attribute: (D) -> K) -> OrderBy<D>.SortKey {
public static func ascending<K: KeyPathStringConvertible>(_ attribute: (D) -> K) -> OrderBy<D>.SortKey {
return .ascending(attribute(D.meta).cs_keyPathString)
}
@@ -273,7 +273,7 @@ extension OrderBy.SortKey where D: CoreStoreObject {
/**
Indicates that the `KeyPathString` should be sorted in descending order
*/
public static func descending<K: DynamicKeyPath>(_ attribute: (D) -> K) -> OrderBy<D>.SortKey {
public static func descending<K: KeyPathStringConvertible>(_ attribute: (D) -> K) -> OrderBy<D>.SortKey {
return .descending(attribute(D.meta).cs_keyPathString)
}