Open
Description
On Apple platforms, ProcessInfo
inherits from NSObject
, and as a result, the default init()
initializer is automatically inferred as public
.
However, on non-Apple platforms (e.g. Linux), ProcessInfo
does not inherit from NSObject
, and init()
is inferred as internal
. This leads to platform inconsistency in the following code:
let info = ProcessInfo()
This compiles successfully on Darwin platforms, but fails to compile on Linux with the error:
error: 'init' is inaccessible due to 'internal' protection level
I would like to ask:
- Is this considered a platform inconsistency that needs to be aligned/fixed?
- Or is it expected that ProcessInfo() is not a supported construction pattern, and the correct usage should always be
ProcessInfo.processInfo
singleton?
Thank you for your clarification and guidance.
Metadata
Metadata
Assignees
Labels
No labels