The name doesn't refer to any variable, function, constant, variant or module in scope. Auk resolves every name at compile time, and the message often suggests a similar name.
Wrong#
fn main() {
let count = 1
print(cout)
}Fixed#
fn main() {
let count = 1
print(count)
}Common causes#
- A typo in a variable or function name.
- A variable used outside the block that declares it.
- A private function of another module, or a variant the enum doesn't have.
- A function from another language's standard library (
len(xs)works,strlendoesn't). - A closure calling itself (
let fib = n => ... fib(n - 1)): the name isn't bound until the closure exists. Write a top-levelfn fib(n: int): intinstead.