Lyricdev
GitHub

struct When

pub struct When :: [OnTopLevel, OnModule]

Conforms to OnTopLevel, OnModule.

Builds the declaration only where cond holds: @When(cond).

cond is computed while compiling, over target and profile. Where it does not hold, the declaration is checked as every other and nothing of it is built; a use the program would run is refused (LYR-CT0006), while a use in the branch a comptime if does not take is allowed. On a module's header it holds for all the module declares: one module per system.

Fields

pub cond: bool