This is an archive of the discontinued LLVM Phabricator instance.

[ObjC] Boxed strings should use the nullability from stringWithUTF8String's return type
ClosedPublic

Authored by arphaman on Nov 7 2017, 2:13 PM.

Details

Summary

Objective-C NSString has a class method stringWithUTF8String that creates a new NSString from a C string. Objective-C box expression @(...) can be used to create an NSString instead of invoking the stringWithUTF8String method directly (The compiler lowers it down to the invocation though). This patch ensures that the type of @(string-value) gets the same nullability attributes as the return type of stringWithUTF8String to ensure that the diagnostics are consistent between the two.

rdar://33847186

Diff Detail

Repository
rL LLVM

Event Timeline

arphaman created this revision.Nov 7 2017, 2:13 PM
ahatanak accepted this revision.Nov 7 2017, 5:44 PM

LGTM

This revision is now accepted and ready to land.Nov 7 2017, 5:44 PM
This revision was automatically updated to reflect the committed changes.