I experimented on macOS, not Linux, but it kept hitting the error you describe until I got the argument for format declared correctly:
let plistXML = Data()
var propertyListFormat: PropertyListSerialization.PropertyListFormat = .xml // Some nonānil placeholder.
let serialized = try PropertyListSerialization.propertyList(
from: plistXML,
options: .mutableContainersAndLeaves,
format: &propertyListFormat
)
So the compiler may be diagnosing your problem incorrectly; it may instead have something to do with a mismatched type being passed to one of the arguments.
Yeah, code looks the same and that compiles fine on MacOS but still not on Linux.
Although you bring up a good point if it was giving you the same error, might be something with how UnsafeMutablePointer<PropertyListFormat>? is treated.
How do you have propertyListFormat declared? My mistake had been to declare it as optional. But UnsafeMutablePointer<PropertyListFormat>? is an optional pointer, not a pointer to an optional format. (See the comment in the earlier code sample. You may have to scroll to the right.)
If you extract the mutableContainersAndLeaves reference you end up with this error:
xcodeproj/Sources/xcodeproj/Project/XcodeProj.swift:85:48: error: 'mutableContainersAndLeaves' is inaccessible due to 'internal' protection level
let a = PropertyListSerialization.ReadOptions.mutableContainersAndLeaves
^