'ID' is inaccessible due to '@_spi' protection level

When I reference the ID of a SwiftData model entity (aka PersistentIdentifier) anywhere as a type (like @State var selection: Set<SomeEntity.ID> = Set<SomeEntity.ID>()) I now get the following error:

'ID' is inaccessible due to '@_spi' protection level

This never was a problem with CoreData and also not with SwiftData until the Xcode 15 RC. Does anybody know, if this is a bug or intended behaviour?

I'm seeing the same issue. As a workaround I've manually added the conformance to Identifiable to the model:

extension MyModel: Identifiable {
    public var id: PersistentIdentifier { persistentModelID }
}

Just declare your model as Identifiable will solve the problem.

'ID' is inaccessible due to '@_spi' protection level
 
 
Q