A warning, on by default.
An if, elseif or else whose block holds no statements does nothing:
immut n: int = 3;if n > 2 {} else { // the 'then' branch is empty -- WARNING printline("small");}The usual fix is to flip the condition so the work lives in the if and the empty branch goes away:
immut n: int = 3;if n <= 2 { printline("small");}If you simply haven’t written the code yet, put a comment such as // TODO in the block. Turf counts a block holding only comments as empty too, so that does not silence the warning, but it does tell the next reader the branch is deliberate. An empty else can simply be deleted.
This is a warning, not an error – compilation still succeeds. To silence it for a whole build, set its lint level to allow: turf build --allow E165 (or [lints] E165 = "allow" in turf.toml).
Run turf --explain E165 in a terminal to read this again.