I’ve got a common package with code for multiple platforms. Sometimes a file is only useful on a single platform (say a category on NSViewController). The only way (I know of) to exclude this is surronding the entire file with a if os() or canImport() call. This causes an editor to indent all the code in the file.
I think it would be useful (and more swifty) to have a conditional that exits evaluation of the file if such a check fails.
Or a “#exit” (name doesn’t matter) that ends compilation of the file. Then it can be included in a #if !os(macOS)
.