http://llvm.org/bugs/show_bug.cgi?id=14062

             Bug #: 14062
           Summary: ObjC BOOL literal becomes integer NSNumber when boxed
           Product: new-bugs
           Version: 3.1
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]
    Classification: Unclassified


Created attachment 9332
  --> http://llvm.org/bugs/attachment.cgi?id=9332
Demonstration source file

When using a boxed expression on a BOOL literal (i.e. @(YES) or @(NO) ), an
integer-type NSNumber is returned instead of a boolean-type NSNumber.

I'm not sure if it's a bug on the 'true' and 'false' boxed booleans, but it
should definitely behave as a boolean for YES and NO.

You can see this behaviour by converting it to JSON. The attached demo file can
be compiled with, assuming a default Xcode installation:

xcrun clang main.m -framework Foundation -isysroot
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/
&& ./a.out

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to