Skip to content

os() platform condition incorrectly defined in prose and language grammar #346

@grynspan

Description

@grynspan

Location

| `os()` | `macOS`, `iOS`, `watchOS`, `tvOS`, `visionOS`, `Linux`, `Windows` |

> *operating-system***`macOS`** | **`iOS`** | **`watchOS`** | **`tvOS`** | **`visionOS`** | **`Linux`** | **`Windows`** \

Description

The lists of valid OS names used with os() are incomplete, as the language supports a variety of other OS names such as WASI and FreeBSD.

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 of os(whatever). So perhaps the grammar should reflect that, if possible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Content issueA problem in with the book's prose, code, or figures

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions