Figure out whether CF collections should be generic #705
Labels
A-framework
Affects the framework crates and the translator for them
enhancement
New feature or request
Relevant for the types
CFArray
,CFBag
,CFBinaryHeap
,CFDictionary
,CFSet
and maybeCFTree
.For a bit of prior art,
core-foundation
, the predecessor toobjc2-core-foundation
, declares these as generic, but the headers themselves do not.This is especially problematic because it prevents any function that takes e.g.
&CFArray
or&CFDictionary
from being marked as safe, because those arrays/dictionaries can contain anything (while the function expects of a certain type, or at least just that the inner type is a CFType). Returned arrays/dictionaries are also harder to use, because you have to manually ensure that they contain the right value.As said, the headers do not provide this type information directly, but perhaps we can enrich it ourselves?
Basically, it comes down to a choice between:
unsafe
, and forcing users to consider the type there.unsafe
.This probably blocks #692 and #693.
The text was updated successfully, but these errors were encountered: