bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #31381] The NSPredicate class using Keyword `SELF` does not work co


From: T.Somequare
Subject: [bug #31381] The NSPredicate class using Keyword `SELF` does not work correctly.
Date: Wed, 20 Oct 2010 07:32:01 +0000
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_8; ja-jp) AppleWebKit/533.18.1 (KHTML, like Gecko) Version/5.0.2 Safari/533.18.5

URL:
  <http://savannah.gnu.org/bugs/?31381>

                 Summary: The NSPredicate class using Keyword `SELF`  does
not work correctly.
                 Project: GNUstep
            Submitted by: tsomeqdev
            Submitted on: 2010年10月20日 07時32分00秒
                Category: Base/Foundation
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

I am afraid there is a bug in the NSPredicate class.
The expected result of exec below is output of "1", but actual result is
"0".
--
 NSString* fmt = @"SELF == 'aaa'";
 NSPredicate* predicate    = [NSPredicate predicateWithFormat:fmt] ;
 BOOL ok = [predicate evaluateWithObject:@"aaa"];
 NSLog(@"[predicate evaluateWithObject:@\"aaa\"] -> %d", ok);
--

I think the problem is in :
 File: NSPredicate.m
 Implementation GSEvaluatedObjectExpression
 Method -(id)expressionValueWithObject:(id)obj context:(NSDictionary*)info  



Index: NSPredicate.m
=============================================
--- NSPredicate.m       (revision 30789)
+++ NSPredicate.m       (working copy)

@@ -1174,7 +1174,7 @@
 - (id) expressionValueWithObject: (id)object
                         context: (NSMutableDictionary *)context
 {
-  return object;
+  return self;
 }

=====================






    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?31381>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]