$ check main
= 0
stacks 0
fn a.b.span none
fn a.b.sizes none
fn a.c.mixed none
fn a.d.packed none
fn a.tick none
$ cc main
= 0
$ fmt
= 0
lang/test/tree_units/a/b.g
lang/test/tree_units/a/c.g
lang/test/tree_units/a/d.g
$ fmt a.b.span
= 0
-- A unit is found as any name is, from here outward, and no local hides
-- it: the local ms is a number, and the ms after a number the root's.
fn span -> Duration = {
  let ms = 2
  ms * 1ms + 3ms
}
$ fmt a.b.sizes
= 0
-- cm and mm are a.len's, a sibling's: one word of its namespace says
-- which. KB is a's, found from here.
fn sizes -> int = 2len.cm / 1len.mm + 4KB / 1KB
$ full a.b.sizes
= 0
-- cm and mm are a.len's, a sibling's: one word of its namespace says
-- which. KB is a's, found from here.
fn sizes -> int = 2@a.len.cm / 1@a.len.mm + 4@a.KB / 1@a.KB
$ fmt a.c.mixed
= 0
-- This namespace has an ms of its own, so the root's is written in full.
fn mixed -> int = 5@ms / 1@ms + 7ms / 1ms
$ full a.c.mixed
= 0
-- This namespace has an ms of its own, so the root's is written in full.
fn mixed -> int = 5@ms / 1@ms + 7@a.c.ms / 1@a.c.ms
$ fmt a.d.packed
= 0
fn packed -> int = {
  var xs = arr 2 byte
  xs[0] = byte 3
  int xs[0] + 2byte / 1byte + tick 4 + 3tick
}
$ full a.d.packed
= 0
fn packed -> int = {
  var xs = arr 2 byte
  xs[0] = byte 3
  int xs[0] + 2@a.d.byte / 1@a.d.byte + @a.tick 4 + 3@a.d.tick
}
$ check a.d.wrong
= 1
E010 a.d.wrong:1 Literal a.tick is no unit: a unit is a constant of a number
E008 a.d.wrong:1 Type tick is not a function
$ fmt a.d.wrong
= 0
-- Each tick where the other belongs, which the checker refuses: the short
-- form keeps the words that say which was written.
fn wrong -> int = 2a.tick + d.tick 4
$ full a.d.wrong
= 0
-- Each tick where the other belongs, which the checker refuses: the short
-- form keeps the words that say which was written.
fn wrong -> int = 2@a.tick + @a.d.tick 4
$ find tick
= 0
fn a.tick n int -> int
  a.d.packed:3
  a.d.wrong:1
const a.d.tick int = 1
  a.d.packed:3
  a.d.wrong:1
$ find ms
= 0
const ms Duration = 1000000ns
  main:1
  a.b.span:2
  a.c.mixed:1
const a.c.ms Tick = 1
  a.c.mixed:1
