You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This way, users will not be forced to incorrectly "bind" memory when they need to copy into a raw pointer and don't know the underlying type.
The raw pointer form is a more general overload, so I expect removing the `UInt8` overloads to be source compatible. They only need to remain as "deprecated" for ABI stability. I'm not sure how to best do this. I think it would even work to remove the public keyword and mark them @usableFromInline so they don't appear in documentation.
I expect this to be completely source compatible but have not verified that with a prototype.
The text was updated successfully, but these errors were encountered:
Deprecation (deliberately) doesn't affect overload resolution, so if this doesn't go into Swift 5 you'll need to leave both overloads forever, for people backwards-deploying. (Or we need an always-emit-into-client annotation, so that we can backwards-deploy the new thing.)
If someone's made a protocol that matches the existing signature, we don't want to break them either.
@belkadan, excellent points. If this doesn't go into Swift 5, I imagine putting @available(introduced) on the new API and @available(deprecated) on the old one without obsoleting it.
I have no strong feelings about it going into Swift 5.
Sorry, my point was that I don't think we can even deprecate the old one. If the pointer you're copying into happens to be an UMP<UInt8>, it'll always pick the old overload even if the new one exists.
Oh, yes of course. Rather than deprecation, we may want an attribute that hides declarations from the documentation. I think we have a number of redundant UnsafePointer-related overloads hanging around. I have mixed feelings about hiding anything from the docs, but I've gotten feedback that the docs need to be simplified to be more approachable.
Additional Detail from JIRA
md5: d4ce88a8326d7388b45b4f881c1d2cd4
relates to:
Issue Description:
In the Foundation Data API...
Add these:
Deprecate these:
This way, users will not be forced to incorrectly "bind" memory when they need to copy into a raw pointer and don't know the underlying type.
The raw pointer form is a more general overload, so I expect removing the `UInt8` overloads to be source compatible. They only need to remain as "deprecated" for ABI stability. I'm not sure how to best do this. I think it would even work to remove the public keyword and mark them @usableFromInline so they don't appear in documentation.
I expect this to be completely source compatible but have not verified that with a prototype.
The text was updated successfully, but these errors were encountered: