Home / Docs / Diagnostics

U0002: Tab in indentation

Release v0.4.0

U0002 reports a tab in the leading whitespace of a line. Tabs inside text literals and comments are not indentation and are allowed.

Why Una rejects it

Una uses significant indentation made of spaces only, two per level (spec/01 §2). A tab in the leading whitespace of a line is rejected, because its width depends on the editor and would make the block structure ambiguous.

How to fix it

The diagnostic carries a mechanical edit that replaces the indentation with spaces.

The repair at a glance

diff
  module demo

  pub double(x: Int) -> Int
    requires x >= 0
  =
- 	x * 2
+   x * 2

Failing example

The body line starts with a tab.

una
module demo

pub double(x: Int) -> Int
  requires x >= 0
=
	x * 2

Fixed example

una
module demo

pub double(x: Int) -> Int
  requires x >= 0
=
  x * 2