Often as developers, we want to use a new API (e.g. Identifiable) which is restricted to an OS newer than our minimum deployment target, or simply conditionally compile code based on our deployment target.
When the code we’re trying to use is in a framework that was introduced in that version, canImport works fine. But when that’s a part of the Swift Standard Library, you have to something sketchy like an #ifdef checking a flag, or make a dummy framework which requires a given OS version and then use canImport.
I propose we extend the conditional compilation syntax to allow for basically the same syntax as SPM:
#if platform(iOS(v13)) || platform(macOS(v10_15))
I understand the preferred approach is to use availability checking, but there are some use cases that does not cover. It also does not conditionally compile the code.