@@ -19,7 +19,7 @@ extension NSObject: PredicateEvaluatable {
1919}
2020*/
2121
22- public extension FetchRequest . Predicate {
22+ internal extension FetchRequest . Predicate {
2323
2424 func toFoundation( ) -> NSPredicate {
2525
@@ -31,7 +31,7 @@ public extension FetchRequest.Predicate {
3131 }
3232}
3333
34- public extension FetchRequest . Predicate . Compound {
34+ internal extension FetchRequest . Predicate . Compound {
3535
3636 func toFoundation( ) -> NSCompoundPredicate {
3737
@@ -40,7 +40,7 @@ public extension FetchRequest.Predicate.Compound {
4040 }
4141}
4242
43- public extension FetchRequest . Predicate . Compound . Logical Type {
43+ internal extension FetchRequest . Predicate . Compound . Logical Type {
4444
4545 func toFoundation( ) -> NSCompoundPredicate . LogicalType {
4646 switch self {
@@ -51,11 +51,16 @@ public extension FetchRequest.Predicate.Compound.LogicalType {
5151 }
5252}
5353
54- public extension FetchRequest . Predicate . Comparison {
54+ internal extension FetchRequest . Predicate . Comparison {
5555
5656 func toFoundation( ) -> NSComparisonPredicate {
5757
5858 let options = self . options. reduce ( NSComparisonPredicate . Options ( ) , { $0. union ( $1. toFoundation ( ) ) } )
59+ var left = self . left
60+ if right. type == . relationship, case var . keyPath( keyPath) = left {
61+ keyPath. append ( . property( NSManagedObject . BuiltInProperty. id. rawValue) )
62+ left = . keyPath( keyPath)
63+ }
5964 return NSComparisonPredicate ( leftExpression: left. toFoundation ( ) ,
6065 rightExpression: right. toFoundation ( ) ,
6166 modifier: modifier? . toFoundation ( ) ?? . direct,
@@ -64,7 +69,7 @@ public extension FetchRequest.Predicate.Comparison {
6469 }
6570}
6671
67- public extension FetchRequest . Predicate . Comparison . Modifier {
72+ internal extension FetchRequest . Predicate . Comparison . Modifier {
6873
6974 func toFoundation( ) -> NSComparisonPredicate . Modifier {
7075
@@ -75,7 +80,7 @@ public extension FetchRequest.Predicate.Comparison.Modifier {
7580 }
7681}
7782
78- public extension FetchRequest . Predicate . Comparison . Operator {
83+ internal extension FetchRequest . Predicate . Comparison . Operator {
7984
8085 func toFoundation( ) -> NSComparisonPredicate . Operator {
8186
@@ -97,7 +102,7 @@ public extension FetchRequest.Predicate.Comparison.Operator {
97102 }
98103}
99104
100- public extension FetchRequest . Predicate . Comparison . Option {
105+ internal extension FetchRequest . Predicate . Comparison . Option {
101106
102107 func toFoundation( ) -> NSComparisonPredicate . Options {
103108
@@ -113,7 +118,7 @@ public extension FetchRequest.Predicate.Comparison.Option {
113118 }
114119}
115120
116- public extension FetchRequest . Predicate . Expression {
121+ internal extension FetchRequest . Predicate . Expression {
117122
118123 func toFoundation( ) -> NSExpression {
119124
0 commit comments