[swift-evolution] Remove isUniquelyReferenced or isUniquelyReferencedNonObjC?
chris at eidhof.nl
Thu Dec 10 11:00:05 CST 2015
I think the name isUniquelyReferenced is better, and it should use the constraint to make sure it only works on Swift objects. That way there’s no confusion.
> On 10 Dec 2015, at 11:56, Joe Groff <jgroff at apple.com> wrote:
>> On Dec 10, 2015, at 8:50 AM, Chris Eidhof via swift-evolution <swift-evolution at swift.org> wrote:
>> There are two functions isUniquelyReferencedNonObjC and isUniquelyReferenced, which do exactly the same thing. One has a more constrained type, only accepting Swift objects. The other one accepts ObjC objects as well, but always returns false. Regardless of whether it should (could?) work for ObjC objects, I think this duplication is confusing (it has confused me for a long time, and I’m happy that I can now see they’re implemented in exactly the same way).
>> I think probably accepting just Swift objects would be the right thing to do, as the function is useless for ObjC objects.
> +1, I think this is just legacy we haven't gotten around to cleaning up.
More information about the swift-evolution