Quite by chance, I stumbled on to what seems to be an error that ought to be 
caught by the compiler but wasn't.  Here's an example:

        NSNumber *testNumber = [NSNumber numberWithInt:5];
        int testInt = (int)testNumber;

However, the value of testInt when running the above is wildly incorrect (as 
one would expect).

The similar code

        NSNumber *testDouble = [NSNumber numberWithDouble:5.77];
        double myDouble = (double)testDouble;

is flagged with the error message "Pointer cannot be cast to type 'double' ", 
as it should be.

I'm running OSX 10.7.5 with Xcode 4.6 and using LLVM (I presume).

Should I file a bug report or is this a well-known anomaly that I've just come 
across?

Boyd



_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to