readium / swift-toolkit

A toolkit for ebooks, audiobooks and comics written in Swift
https://readium.org/mobile/
BSD 3-Clause "New" or "Revised" License
225 stars 96 forks source link

Stored properties cannot be marked unavailable with @available #322

Closed kristojorg closed 11 months ago

kristojorg commented 11 months ago

Bug Report

I am running XCode 15 beta on Mac OS Sonoma and cannot compile an iOS app using the Readium streamer. I get an error from Streamer/Server/PublicationServer: "Stored properties cannot be marked unavailable with @available".

The offending code is:

    // Mapping between endpoint and the matching container.
    @available(*, unavailable, message: "`Container` is not used anymore in the `PublicationServer")
    public private(set) var containers: [String: Container] = [:]

What happened?

I upgraded to XCode 15 beta and was no longer able to compile my app.

Expected behavior

Should compile

How to reproduce?

Upgrade to MacOS Sonoma and Xcode 15 beta (I recommend on a separate volume), try to compile an app using readium.

Environment

Development environment

Testing device

Additional context

It seems we are attempting to deprecate this class and these properties, as we are marking them unavailable always. Should we instead use the deprecated argument instead of unavailable? If we truly want it to not be usable at all (and I believe it currently is not), can we simply remove it?

It also seems unnecessary to mark these as unavailable if the whole class is already marked unavailable? Happy to make a PR if you tell me your preferred route