kishikawakatsumi / KeychainAccess

Simple Swift wrapper for Keychain that works on iOS, watchOS, tvOS and macOS.
MIT License
7.92k stars 785 forks source link

Deprecation warnings for watchOS #542

Closed mickyzinho closed 2 years ago

mickyzinho commented 2 years ago

Maybe more a question than an issue: Some constants in Keychain.swift show as deprecated in watchOS 7.0 (see screenshot). But some of those are just used inside a constant with @available(watchOS, unavailable). Why does this give a warning? Can't the compiler infer that the deprecated constants are only used inside unavailable code? Is this a flaw in LVVM? Can we somehow make these warnings disappear?

Screenshot 2022-05-18 at 08 53 25

:

mickyzinho commented 2 years ago

Ok, looks like the compiler does evaluate @available all the time. But wrapping those in #if !os(watchOS) seems to work.