os()
platform condition incorrectly defined in prose and language grammar
#346
Labels
Content issue
A problem in with the book's prose, code, or figures
Location
swift-book/TSPL.docc/ReferenceManual/Statements.md
Line 1007 in d293687
swift-book/TSPL.docc/ReferenceManual/SummaryOfTheGrammar.md
Line 701 in d293687
Description
The lists of valid OS names used with
os()
are incomplete, as the language supports a variety of other OS names such asWASI
andFreeBSD
.Correction
We should either leave the list open-ended, or try to comprehensively list everything the compiler supports.
It's also worth noting that if a developer passes some unsupported OS name, it's not a compiler error—the compiler will accept it, emit a warning, and just ignore the code as if it said
false
instead ofos(whatever)
. So perhaps the grammar should reflect that, if possible.The text was updated successfully, but these errors were encountered: