Created
December 18, 2018 15:30
-
-
Save markd2/722e1f57f173f1a045e63d3fa5c59dd2 to your computer and use it in GitHub Desktop.
Does `copy` really strip off mutability?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
// clang -g -framework Foundation -o mute mute.m | |
int main(void) { | |
NSMutableString *blarg = NSMutableString.new; | |
NSString *copy = blarg.copy; | |
NSLog(@"%@ | %@", blarg.class, copy.class); | |
return 0; | |
} | |
#if 0 | |
% clang -g -framework Foundation -o mute mute.m | |
% ./mute | |
2018-12-18 10:30:27.461 mute[84191:14368442] __NSCFString | __NSCFConstantString | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment