SE-0044 Import as member mentions an “automatic inference heuristics” feature to import C functions as properties, methods, etc automatically, based off of the variable/function's name and type:
Automatic inference
Coupled with this manual specification ability is an automatic inference system. The inference system analyzes C global names and types, attempting to find an imported Swift type to extend with a method, initializer, or property from this global.
This inference system's goal is to be able to automatically handle the majority of global variables and functions in CF-style frameworks, and in the future be extensible to benefit other well structured, disciplined APIs.
Amendment: Automatic inference will not be used by default for all C APIs, but will be opt-in.
My questions are:
- Has this feature been implemented?
- If it has been implemented: How does one “opt-in” to use it?
Regards, Martin