Docs menu

E196: An empty function body

What compiler warning E196 means, and how to fix it.

A warning, on by default. Since TurfLang 2.3.

A function that returns nothing and whose body holds no statements does nothing when it is called:

Example
fn reset(): void {}                           // the body is empty -- WARNING

Write the function, or remove it and its calls. A @test function may be empty (an empty test passes by returning), and a function that returns a value is reported by E009 instead.

If the function is meant to do nothing, put a comment in the body saying why. A body holding a comment does not warn:

Example
fn reset(): void {    // nothing to reset: the defaults are right}

A generic function warns once, however many types it is used with.

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 E196 (or [lints] E196 = "allow" in turf.toml).

Run turf --explain E196 in a terminal to read this again.

Last updated: Oct 15, 2026Edit this page on GitHub

Esc

Type to search.