Diagnostics

Every error the compiler reports has a code, such as E0236, that names its kind and stays the same from release to release. The command line shows it before the place:

[ERROR E0236] main.cz:12:7: Unknown variable 'cuont'; did you mean 'count'?

This page has a section for each code: the message, with * for the parts that change from one error to the next, the part of the compiler that finds it, and, for most, a short program that has it.

For tools

cuarzo check --json <file.cz> prints every error of a program, with no limit, as a JSON array on standard output, and exits with status 1 if there is one ([] and status 0 otherwise). Each diagnostic has:

  • file, line, and col: where it points, as the command line shows;
  • start_line, start_col, end_line, and end_col: the code it covers, ending just after it (all 0 when only the point is known);
  • severity: error, warning, information, or hint;
  • code and message;
  • related: other places that explain it, each with file, line, col, and message, such as where a name was first declared;
  • fixes: changes that would mend it, each with a title and edits, where an edit puts text in place of what is from line and col to end_line and end_col (the same place, for an insertion).

Columns count UTF-8 bytes from 1; positions.cz in the compiler converts them to the UTF-16 columns of the Language Server Protocol. A program that uses the compiler as a library gets the same diagnostics from check_program in compiler/compiler.cz.

Fixes are offered for:

  • a misspelled variable (Change to 'count'), when a visible name is one or two edits away;
  • a value that needs a conversion (Convert with int(...), to_bytes, or from_utf8);
  • a match that does not handle every member of an enum (Add a branch for them);
  • a name declared in a module the file does not import (Import "util").

A name declared twice relates to its first declaration.

cuarzo lint <file.cz> reports warnings too: valid code that is likely wrong, with codes from W0001 (see Warnings). A comment lint: allow W0001 on the line of a warning, or on the line before, silences it there, and lint: allow-file W0001 anywhere in a file silences it in the whole file; with no code, it silences every warning. A name that starts with _ is meant to go unused.

Codes

E0001

Invalid escape sequence

Found by the lexer, reading the characters of a file.

str s = "a\
[ERROR E0001] main.cz:1:11: Invalid escape sequence

E0002

Unclosed comment

Found by the lexer, reading the characters of a file.

/* missing end
[ERROR E0002] main.cz:1:1: Unclosed comment

E0003

Unclosed string

Found by the lexer, reading the characters of a file.

str value = "missing end
[ERROR E0003] main.cz:1:13: Unclosed string

E0004

Write '}}' for a '}' in an f-string

Found by the lexer, reading the characters of a file.

print(f"a } b")
[ERROR E0004] main.cz:1:11: Write '}}' for a '}' in an f-string

E0005

Unclosed '{' in an f-string

Found by the lexer, reading the characters of a file.

E0006

Expected a format spec and '}' after ':' in an f-string

Found by the lexer, reading the characters of a file.

print(f"{1:}")
[ERROR E0006] main.cz:1:12: Expected a format spec and '}' after ':' in an f-string

E0007

Unclosed bytes literal

Found by the lexer, reading the characters of a file.

print(b"abc)
[ERROR E0007] main.cz:1:7: Unclosed bytes literal

E0008

Unclosed char literal

Found by the lexer, reading the characters of a file.

char c = '
[ERROR E0008] main.cz:1:10: Unclosed char literal

E0009

A character literal holds one byte; use a string

Found by the lexer, reading the characters of a file.

char c = '\u{e9}'
[ERROR E0009] main.cz:1:10: A character literal holds one byte; use a string

E0010

Invalid character literal

Found by the lexer, reading the characters of a file.

char c = ''
[ERROR E0010] main.cz:1:10: Invalid character literal

E0011

Invalid number: unexpected '*'

Found by the lexer, reading the characters of a file.

print(1e)
[ERROR E0011] main.cz:1:8: Invalid number: unexpected 'e'

E0012

A '_' in a number must stand between two digits

Found by the lexer, reading the characters of a file.

print(1_)
[ERROR E0012] main.cz:1:8: A '_' in a number must stand between two digits

E0013

Expected * digits after '*'

Found by the lexer, reading the characters of a file.

print(0x)
[ERROR E0013] main.cz:1:7: Expected hexadecimal digits after '0x'

E0014

Invalid digit '*' in * * number

Found by the lexer, reading the characters of a file.

print(0xfg)
[ERROR E0014] main.cz:1:10: Invalid digit 'g' in a hexadecimal number

E0015

Unexpected character '*'

Found by the lexer, reading the characters of a file.

print(1) \
[ERROR E0015] main.cz:1:10: Unexpected character '\'

E0016

Unexpected character

Found by the lexer, reading the characters of a file.

int café = 1
[ERROR E0016] main.cz:1:8: Unexpected character

E0017

Code is nested too deeply

Found by the parser, reading the shape of the code.

E0018

'*' is a type name

Found by the parser, reading the shape of the code.

enum E do
 A
end
int E = 1
[ERROR E0018] main.cz:4:5: 'E' is a type name

E0019

'*' is the name of an imported module

Found by the parser, reading the shape of the code.

E0020

Unexpected 'end'

Found by the parser, reading the shape of the code.

E0021

Expected the name of a module attribute

Found by the parser, reading the shape of the code.

E0022

Expected a string in the module attribute

Found by the parser, reading the shape of the code.

E0023

Expected ')' after the module attribute's value

Found by the parser, reading the shape of the code.

E0024

Expected ']' after the module attribute

Found by the parser, reading the shape of the code.

E0025

Unknown module attribute '*'; a module can be #![unsafe] or #![link("name")]

Found by the parser, reading the shape of the code.

#![fast]
[ERROR E0025] main.cz:1:4: Unknown module attribute 'fast'; a module can be #![unsafe] or #![link("name")]

E0026

Module attributes come first in a file, before its imports and declarations

Found by the parser, reading the shape of the code.

print(1)
#![unsafe]
[ERROR E0026] main.cz:2:1: Module attributes come first in a file, before its imports and declarations

E0027

Expected a struct, an enum, or an extern declaration after the attribute

Found by the parser, reading the shape of the code.

#[derive(Equal)]
func f() do
end
[ERROR E0027] main.cz:2:1: Expected a struct, an enum, or an extern declaration after the attribute

E0028

Imported files may only contain declarations and imports

Found by the parser, reading the shape of the code.

E0029

Expected the name of an attribute

Found by the parser, reading the shape of the code.

E0030

Expected a name in the attribute

Found by the parser, reading the shape of the code.

E0031

Expected ')' after the attribute's values

Found by the parser, reading the shape of the code.

E0032

Expected ']' after the attribute

Found by the parser, reading the shape of the code.

E0033

Unknown attribute '*' on a field; expected json(...)

Found by the parser, reading the shape of the code.

E0034

Unknown attribute '*'; a type takes derive(...)

Found by the parser, reading the shape of the code.

#[foo]
struct P do
 int x
end
[ERROR E0034] main.cz:1:3: Unknown attribute 'foo'; a type takes derive(...)

E0035

Expected a declaration or an import after 'pub'

Found by the parser, reading the shape of the code.

pub print(1)
[ERROR E0035] main.cz:1:5: Expected a declaration or an import after 'pub'

E0036

Expected DO after the condition

Found by the parser, reading the shape of the code.

E0037

Expected a module path string after 'import'

Found by the parser, reading the shape of the code.

import
[ERROR E0037] main.cz:1:7: Expected a module path string after 'import'

E0038

Import paths must be relative

Found by the parser, reading the shape of the code.

import ""
[ERROR E0038] main.cz:1:8: Import paths must be relative

E0039

A module passed on with pub import cannot be given a name

Found by the parser, reading the shape of the code.

pub import "std/term" as term
[ERROR E0039] main.cz:1:23: A module passed on with pub import cannot be given a name

E0040

Expected a name after 'as'

Found by the parser, reading the shape of the code.

E0041

Another import is already named '*'

Found by the parser, reading the shape of the code.

when true do
 import "std/fs" as fs
else
 import "std/term" as fs
end
print(fs.exists("x"))
import "std/time" as fs
[ERROR E0041] main.cz:7:22: Another import is already named 'fs'

E0042

There is no standard library module '*'

Found by the parser, reading the shape of the code.

import "std/nope"
[ERROR E0042] main.cz:1:8: There is no standard library module 'std/nope'

E0043

Cannot find module '*' (looked for *)

Found by the parser, reading the shape of the code.

import "missing"
[ERROR E0043] main.cz:1:8: Cannot find module 'missing' (looked for build/tests/missing.cz)

E0044

Declarations are only allowed at the top level

Found by the parser, reading the shape of the code.

if true then
 enum E do
 A
 end
end
[ERROR E0044] main.cz:2:2: Declarations are only allowed at the top level

E0045

Async functions are declared at the top level or in a type

Found by the parser, reading the shape of the code.

print(async func() do
end)
[ERROR E0045] main.cz:1:7: Async functions are declared at the top level or in a type

E0046

Imports are only allowed at the top level

Found by the parser, reading the shape of the code.

func f() do
 import "x"
end
[ERROR E0046] main.cz:2:2: Imports are only allowed at the top level

E0047

'pub' marks declarations at the top level

Found by the parser, reading the shape of the code.

func f() do
 pub func g() do
 end
end
[ERROR E0047] main.cz:2:2: 'pub' marks declarations at the top level

E0048

Constants are only allowed at the top level

Found by the parser, reading the shape of the code.

func f() do
 const int A = 1
end
[ERROR E0048] main.cz:2:2: Constants are only allowed at the top level

E0049

Expected a variable declaration after '*'

Found by the parser, reading the shape of the code.

func f() do
 let 5
end
[ERROR E0049] main.cz:2:6: Expected a variable declaration after 'let'

E0050

Expected a type and a name, or _

Found by the parser, reading the shape of the code.

E0051

Expected ')' after the names

Found by the parser, reading the shape of the code.

E0052

A tuple has at least two items

Found by the parser, reading the shape of the code.

E0053

'return' outside of a function

Found by the parser, reading the shape of the code.

return
[ERROR E0053] main.cz:1:1: 'return' outside of a function

E0054

'return' cannot be in deferred code, which runs as the block ends

Found by the parser, reading the shape of the code.

func f() do
 defer return
end
[ERROR E0054] main.cz:2:8: 'return' cannot be in deferred code, which runs as the block ends

E0055

Expected '=' after the name in with

Found by the parser, reading the shape of the code.

E0056

'*' outside of a loop

Found by the parser, reading the shape of the code.

break
[ERROR E0056] main.cz:1:1: 'break' outside of a loop

E0057

Invalid assignment target

Found by the parser, reading the shape of the code.

(1 + 2) = 3
[ERROR E0057] main.cz:1:9: Invalid assignment target

E0058

Expression statements must be calls

Found by the parser, reading the shape of the code.

x
[ERROR E0058] main.cz:1:1: Expression statements must be calls

E0059

Unknown type '*'; a method is declared on a type, as in func Point.length(self)

Found by the parser, reading the shape of the code.

E0060

Expected ')' after parameters

Found by the parser, reading the shape of the code.

func f(int a int b) do
end
[ERROR E0060] main.cz:1:14: Expected ')' after parameters

E0061

Expected a return type or DO

Found by the parser, reading the shape of the code.

func f() foo do
end
[ERROR E0061] main.cz:1:10: Expected a return type or DO

E0062

Expected func, struct, union, const, or var after 'extern'

Found by the parser, reading the shape of the code.

E0063

Expected the name of the C function

Found by the parser, reading the shape of the code.

E0064

Unknown attribute '*' on an extern function; use link, symbol, header, or stdcall

Found by the parser, reading the shape of the code.

#![unsafe]
#[fast]
extern func f() c_int
[ERROR E0064] main.cz:3:8: Unknown attribute 'fast' on an extern function; use link, symbol, header, or stdcall

E0065

'...' comes last in the parameters

Found by the parser, reading the shape of the code.

E0066

Expected the type of a parameter

Found by the parser, reading the shape of the code.

E0067

Expected ')' after the parameters

Found by the parser, reading the shape of the code.

E0068

Expected the result type of the C function

Found by the parser, reading the shape of the code.

E0069

Expected the name of the C *

Found by the parser, reading the shape of the code.

E0070

Unknown attribute '*' on a C *; use #[packed], #[align(n)], #[header], or #[symbol]

Found by the parser, reading the shape of the code.

#![unsafe]
#[fast]
extern struct P do
 c_int x
end
[ERROR E0070] main.cz:3:8: Unknown attribute 'fast' on a C struct; use #[packed], #[align(n)], #[header], or #[symbol]

E0071

Expected the type of a field

Found by the parser, reading the shape of the code.

E0072

A C * has at least one field

Found by the parser, reading the shape of the code.

E0073

Unknown attribute '*' on an extern *; use link, symbol, or header

Found by the parser, reading the shape of the code.

E0074

Expected the type of the extern *

Found by the parser, reading the shape of the code.

E0075

Expected the name of the extern *

Found by the parser, reading the shape of the code.

E0076

Expected a function declaration after 'async'

Found by the parser, reading the shape of the code.

async x
[ERROR E0076] main.cz:1:1: Expected a function declaration after 'async'

E0077

Type parameter '*' is repeated

Found by the parser, reading the shape of the code.

func f[T, T](T x) do
end
[ERROR E0077] main.cz:1:11: Type parameter 'T' is repeated

E0078

Expected an interface after ':'

Found by the parser, reading the shape of the code.

E0079

Expected an interface after '+'

Found by the parser, reading the shape of the code.

E0080

Expected ']' after type parameters

Found by the parser, reading the shape of the code.

E0081

Expected a type in parameter list

Found by the parser, reading the shape of the code.

enum B[T] do
 X(U v)
end
[ERROR E0081] main.cz:2:4: Expected a type in parameter list

E0082

Parameter '*' needs a default, since one before it has one

Found by the parser, reading the shape of the code.

func f(int a = 1, int b) do
end
[ERROR E0082] main.cz:1:19: Parameter 'b' needs a default, since one before it has one

E0083

* cannot have defaults

Found by the parser, reading the shape of the code.

enum E do
 A(int x = 1)
end
[ERROR E0083] main.cz:2:12: The values of a member cannot have defaults

E0084

Enum '*' must have at least one member

Found by the parser, reading the shape of the code.

enum Empty do
end
[ERROR E0084] main.cz:1:1: Enum 'Empty' must have at least one member

E0085

Expected a member after the attribute

Found by the parser, reading the shape of the code.

E0086

Expected an integer for the member's value

Found by the parser, reading the shape of the code.

enum E do
 A = x
end
[ERROR E0086] main.cz:2:6: Expected an integer for the member's value

E0087

Member '*' needs at least one value; leave out the parentheses

Found by the parser, reading the shape of the code.

enum E do
 A()
end
[ERROR E0087] main.cz:2:2: Member 'A' needs at least one value; leave out the parentheses

E0088

Expected ')' after the member's values

Found by the parser, reading the shape of the code.

E0089

Expected a method, as func name(self) result, or END

Found by the parser, reading the shape of the code.

E0090

Interface '*' must ask for at least one method

Found by the parser, reading the shape of the code.

E0091

Expected the name of a method

Found by the parser, reading the shape of the code.

E0092

A method of an interface takes self first

Found by the parser, reading the shape of the code.

E0093

Expected a result type or the end of the line

Found by the parser, reading the shape of the code.

E0094

Interface '*' already asks for '*'

Found by the parser, reading the shape of the code.

E0095

Struct '*' must have at least one field

Found by the parser, reading the shape of the code.

struct Empty do
end
[ERROR E0095] main.cz:1:1: Struct 'Empty' must have at least one field

E0096

Expected a field type or END

Found by the parser, reading the shape of the code.

struct S do
 foo x
end
[ERROR E0096] main.cz:2:2: Expected a field type or END

E0097

Expected a type after '*'

Found by the parser, reading the shape of the code.

shared 5
[ERROR E0097] main.cz:1:8: Expected a type after 'shared'

E0098

Expected '[' after c_array, as in c_array[c_int, 4]

Found by the parser, reading the shape of the code.

E0099

Expected the type of the array's items

Found by the parser, reading the shape of the code.

E0100

Expected ',' and the number of items, as in c_array[c_int, 4]

Found by the parser, reading the shape of the code.

E0101

Expected the number of items, as in c_array[c_int, 4]

Found by the parser, reading the shape of the code.

E0102

Expected ']' after the number of items

Found by the parser, reading the shape of the code.

E0103

Expected '[' after ptr, as in ptr[c_int]

Found by the parser, reading the shape of the code.

E0104

Expected the type a pointer points to

Found by the parser, reading the shape of the code.

E0105

Expected ']' after the type a pointer points to

Found by the parser, reading the shape of the code.

E0106

Expected a type argument

Found by the parser, reading the shape of the code.

E0107

Expected ']' after type arguments

Found by the parser, reading the shape of the code.

E0108

Expected ']' in array type

Found by the parser, reading the shape of the code.

int[ values = []
[ERROR E0108] main.cz:1:6: Expected ']' in array type

E0109

'void' is only valid as a function return type

Found by the parser, reading the shape of the code.

void x = 1
[ERROR E0109] main.cz:1:1: 'void' is only valid as a function return type

E0110

Expected a type in the tuple

Found by the parser, reading the shape of the code.

E0111

Expected ')' after the tuple's types

Found by the parser, reading the shape of the code.

E0112

Expected '(' after 'c_func'

Found by the parser, reading the shape of the code.

E0113

Expected a parameter type

Found by the parser, reading the shape of the code.

E0114

Expected ')' after the parameter types

Found by the parser, reading the shape of the code.

E0115

Expected '(' after 'func' in a function type

Found by the parser, reading the shape of the code.

E0116

'await' cannot be in deferred code, which runs as the block ends

Found by the parser, reading the shape of the code.

async func g() int do
 defer do
  await g()
 end
 return 1
end
[ERROR E0116] main.cz:3:3: 'await' cannot be in deferred code, which runs as the block ends

E0117

'await' can only be used in an async function or in the program's body

Found by the parser, reading the shape of the code.

func f() int do
 return await g()?
end
async func g() int do
 return 1
end
[ERROR E0117] main.cz:2:9: 'await' can only be used in an async function or in the program's body

E0118

Expected ')' after arguments

Found by the parser, reading the shape of the code.

print(1 2)
[ERROR E0118] main.cz:1:9: Expected ')' after arguments

E0119

Expected a field name after '.'

Found by the parser, reading the shape of the code.

struct S do
 int x
end
S s = S(1)
print(s.)
[ERROR E0119] main.cz:5:9: Expected a field name after '.'

E0120

Expected ']' after index

Found by the parser, reading the shape of the code.

int[] v = [1]
print(v[0)
[ERROR E0120] main.cz:2:10: Expected ']' after index

E0121

Expected a type in *

Found by the parser, reading the shape of the code.

E0122

Expected ')' after the type in *

Found by the parser, reading the shape of the code.

E0123

Expected ')' after the tuple's items

Found by the parser, reading the shape of the code.

E0124

Expected ']' after array literal

Found by the parser, reading the shape of the code.

print([1, 2)
[ERROR E0124] main.cz:1:12: Expected ']' after array literal

E0125

Unexpected token: *

Found by the parser, reading the shape of the code.

int x =
[ERROR E0125] main.cz:1:8: Unexpected token: NEWLINE

E0126

Unexpected type name '*'

Found by the parser, reading the shape of the code.

struct S do
 int x
end
print(S)
[ERROR E0126] main.cz:4:7: Unexpected type name 'S'

E0127

Expected '(' to make a *

Found by the parser, reading the shape of the code.

E0128

Expected the name of a function of '*' after '.'

Found by the parser, reading the shape of the code.

E0129

Expected ')' after the value to convert

Found by the parser, reading the shape of the code.

E0130

Expected a name after '*.'

Found by the parser, reading the shape of the code.

E0131

Expected '.' after enum '*'

Found by the parser, reading the shape of the code.

E0132

Expected WHEN

Found by the parser, reading the shape of the code.

match 1 do
end
[ERROR E0132] main.cz:2:1: Expected WHEN

E0133

Expected ')' after the tuple's patterns

Found by the parser, reading the shape of the code.

E0134

Expected a pattern; a pattern names a value without its type

Found by the parser, reading the shape of the code.

Result[int] r = Result.OK(1)
match r do
 when OK(int n) then
  print(1)
 else
end
[ERROR E0134] main.cz:3:10: Expected a pattern; a pattern names a value without its type

E0135

Expected a pattern: a literal, a constant, a name, an enum member, a struct, or a tuple

Found by the parser, reading the shape of the code.

match 1 do
 when then
end
[ERROR E0135] main.cz:2:7: Expected a pattern: a literal, a constant, a name, an enum member, a struct, or a tuple

E0136

Expected ')' after the patterns

Found by the parser, reading the shape of the code.

E0137

Expected '(' after 'func'

Found by the parser, reading the shape of the code.

E0138

Expected a parameter

Found by the parser, reading the shape of the code.

E0139

Expected '=>', 'do', or a result type

Found by the parser, reading the shape of the code.

E0140

Expected '=>' or 'do' before the function's body

Found by the parser, reading the shape of the code.

E0141

Expected an expression between '{' and '}'

Found by the parser, reading the shape of the code.

print(f"{}")
[ERROR E0141] main.cz:1:10: Expected an expression between '{' and '}'

E0142

Expected '}' after the expression

Found by the parser, reading the shape of the code.

E0143

Expected ':' after a map key

Found by the parser, reading the shape of the code.

map[str, int] m = {"a" 1}
[ERROR E0143] main.cz:1:24: Expected ':' after a map key

E0144

Expected '}' after map literal

Found by the parser, reading the shape of the code.

E0145

Unexpected token: RPAREN

Found by the parser, reading the shape of the code.

print(1,)
[ERROR E0145] main.cz:1:9: Unexpected token: RPAREN

E0146

An async function's Result must have the error type Error, not '*'

Found by the parser, turning an async function into plain ones.

async func g() Result[int, str] do
 return Result.OK(1)
end
[ERROR E0146] main.cz:1:1: An async function's Result must have the error type Error, not 'str'

E0147

An async function of a type needs self, as in async func *(self)

Found by the parser, turning an async function into plain ones.

struct S do
 async func make() int do
  return 1
 end
end
[ERROR E0147] main.cz:2:2: An async function of a type needs self, as in async func make(self)

E0148

Module '*' is only imported on another platform

Found by the resolver, finding what each name means across modules.

when false do
 import "std/fs" as fs
end
print(fs.exists("x"))
[ERROR E0148] main.cz:4:10: Module 'fs' is only imported on another platform

E0149

'*' is private to *; mark it pub to use it from other modules

Found by the resolver, finding what each name means across modules.

E0150

Module '*' has no '*'

Found by the resolver, finding what each name means across modules.

E0151

'*' belongs to the module imported as '*'; write *.*

Found by the resolver, finding what each name means across modules.

E0152

'*' is declared in *, which this file does not import

Found by the resolver, finding what each name means across modules.

E0153

* needs the module marked #![unsafe] at its top

Found by the checker, as it checks declarations.

ptr[void] p = c_alloc(4)
[ERROR E0153] main.cz:1:15: c_alloc needs the module marked #![unsafe] at its top

E0154

Name '*' is reserved

Found by the checker, as it checks declarations.

func pop() do
end
[ERROR E0154] main.cz:1:1: Name 'pop' is reserved

E0155

Name '*' is already defined

Found by the checker, as it checks declarations.

enum Option do
 A
end
[ERROR E0155] main.cz:1:1: Name 'Option' is already defined
  prelude.cz:9:1: 'Option' is first declared here

E0156

Enum '*' has members that carry values, so its members cannot have numbers

Found by the checker, as it checks declarations.

enum E do
 A = 1
 B(int x)
end
[ERROR E0156] main.cz:2:2: Enum 'E' has members that carry values, so its members cannot have numbers

E0157

Enum '*' already has a member with the value *

Found by the checker, as it checks declarations.

enum E do
 A = 1
 B = 1
end
[ERROR E0157] main.cz:3:2: Enum 'E' already has a member with the value 1

E0158

The value of '*.*' does not fit an i32

Found by the checker, as it checks declarations. An enum's members are numbers of 32 bits, as C's enums are.

enum E do
 A = 3000000000
end
[ERROR E0158] main.cz:2:2: The value of 'E.A' does not fit an i32

E0159

Enum '*' already has member '*'

Found by the checker, as it checks declarations.

enum A do
 X
 X
end
[ERROR E0159] main.cz:3:2: Enum 'A' already has member 'X'

E0160

Member '*.*' already has a value named '*'

Found by the checker, as it checks declarations.

enum E do
 A(int x, str x)
end
[ERROR E0160] main.cz:2:11: Member 'E.A' already has a value named 'x'

E0161

Struct '*' already has field '*'

Found by the checker, as it checks declarations.

struct P do
 int x
 str x
end
[ERROR E0161] main.cz:3:2: Struct 'P' already has field 'x'

E0162

Function '*' can end without returning a value

Found by the checker, as it checks declarations.

func f() int do
end
[ERROR E0162] main.cz:1:1: Function 'f' can end without returning a value

E0163

Name '*' is a constant

Found by the checker, as it checks declarations.

const int A = 1
int A = 2
[ERROR E0163] main.cz:2:1: Name 'A' is a constant

E0164

Variable '*' is already declared

Found by the checker, as it checks declarations.

int x = 1
int x = 2
[ERROR E0164] main.cz:2:1: Variable 'x' is already declared

E0165

Constant '*' depends on itself: *

Found by the checker, as it checks declarations.

const int A = B
const int B = A
[ERROR E0165] main.cz:1:1: Constant 'A' depends on itself: A uses B uses A

E0166

Constant '*' depends on itself

Found by the checker, as it checks declarations.

E0167

Cannot initialize '*' with '*'

Found by the checker, as it checks declarations.

int x = 2.5
[ERROR E0167] main.cz:1:1: Cannot initialize 'int' with 'float'; convert it with int(...), which drops the fraction

E0168

Cannot change constant '*'; declare it with shared to change it

Found by the checker, as it checks declarations.

const int[] A = [1]
push(A, 2)
[ERROR E0168] main.cz:2:6: Cannot change constant 'A'; declare it with shared to change it

E0169

Type '*' already has a method '*'

Found by the checker, as it checks declarations.

#[derive(Equal)]
struct P do
 int x
 func equals(self, P o) bool do
  return true
 end
end
[ERROR E0169] main.cz:1:10: Type 'P' already has a method 'equals'

E0170

Struct '*' has a field '*'; a method cannot have its name

Found by the checker, as it checks declarations.

E0171

'*' is not an interface; a type parameter can only be bound by interfaces

Found by the checker, as it checks declarations.

E0172

Put the '?' first in this expression, or store the values before it in variables

Found by the checker, as it checks declarations.

func f(int[] a) Result[int] do
 return Result.OK(a[0] + parse_int("1")?)
end
[ERROR E0172] main.cz:2:40: Put the '?' first in this expression, or store the values before it in variables

E0173

'?' cannot be used in a function written with =>; write it with do, or as a named function

Found by the checker, as it checks declarations.

func(str) Result[int] f = func(str s) => Result.OK(parse_int(s)?)
[ERROR E0173] main.cz:1:64: '?' cannot be used in a function written with =>; write it with do, or as a named function

E0174

'?' cannot be used here; use it in a declaration, an assignment, a return, a call statement, an if, or a match

Found by the checker, as it checks declarations.

func f() Result[int] do
 while parse_int("1")? > 0 do
 end
 return Result.OK(1)
end
[ERROR E0174] main.cz:2:22: '?' cannot be used here; use it in a declaration, an assignment, a return, a call statement, an if, or a match

E0175

Give this function's result type, as in func(...) Result[int] do, to use '?' in it

Found by the checker, as it checks declarations.

int[][] r = [map(["1"], func(s) do
 return Result.OK(parse_int(s)?)
end)]
[ERROR E0175] main.cz:2:31: Give this function's result type, as in func(...) Result[int] do, to use '?' in it

E0176

'?' needs a function that returns a Result or an Option, not '*'

Found by the checker, as it checks declarations.

func f() do
 int x = parse_int("1")?
end
[ERROR E0176] main.cz:2:24: '?' needs a function that returns a Result or an Option, not 'void'

E0177

'?' needs a Result or an Option, not '*'

Found by the checker, as it checks declarations.

func f() Result[int] do
 int x = 5?
 return Result.OK(x)
end
[ERROR E0177] main.cz:2:11: '?' needs a Result or an Option, not 'int'

E0178

The message after '?' must be a str, not '*'

Found by the checker, as it checks declarations.

E0179

Cannot tell the type inside this '*'; store it in a variable with a declared type

Found by the checker, as it checks declarations.

E0180

'?' here needs an Option to match the function's result, not '*'

Found by the checker, as it checks declarations.

func f() Option[int] do
 return Option.SOME(parse_int("1")?)
end
[ERROR E0180] main.cz:2:35: '?' here needs an Option to match the function's result, not 'Result[int]'

E0181

A message after '?' adds to an error, so it needs a function that returns a Result

Found by the checker, as it checks declarations.

func f() Option[int] do
 Option[int] o = Option.NONE
 int x = o ? "no x"
 return o
end
[ERROR E0181] main.cz:3:14: A message after '?' adds to an error, so it needs a function that returns a Result

E0182

'?' on an Option in a function that returns a Result needs a message for the error, as in value ? "no value"

Found by the checker, as it checks declarations.

func f() Result[int] do
 Option[int] o = Option.NONE
 int x = o?
 return Result.OK(x)
end
[ERROR E0182] main.cz:3:11: '?' on an Option in a function that returns a Result needs a message for the error, as in value ? "no value"

E0183

A message after '?' makes an Error, but this function's errors are '*'

Found by the checker, as it checks declarations.

E0184

A message after '?' adds to an Error, but these errors are '*'

Found by the checker, as it checks declarations.

func f() Result[int, str] do
 Result[int, str] r = Result.OK(1)
 int x = r ? "more"
 return r
end
[ERROR E0184] main.cz:3:14: A message after '?' adds to an Error, but these errors are 'str'

E0185

'?' cannot pass a '*' error on as '*'; give '*' a function from(* error) *

Found by the checker, as it checks declarations.

func f() Result[int, str] do
 int x = parse_int("1")?
 return Result.OK(x)
end
[ERROR E0185] main.cz:2:24: '?' cannot pass a 'Error' error on as 'str'; give 'str' a function from(Error error) str

E0186

Unsupported statement

Found by the checker, as it checks statements.

E0187

Cannot tell the type of '*' from this value

Found by the checker, as it checks statements.

with x = null do
end
[ERROR E0187] main.cz:1:10: Cannot tell the type of 'x' from this value

E0188

'*' has no method close(self), which with calls when the block ends

Found by the checker, as it checks statements.

with x = 5 do
end
[ERROR E0188] main.cz:1:10: 'int' has no method close(self), which with calls when the block ends

E0189

Cannot initialize '*' with '*'*

Found by the checker, as it checks statements.

E0190

Cannot take '*' apart into * values

Found by the checker, as it checks statements.

E0191

Cannot assign to constant '*'

Found by the checker, as it checks statements.

const int A = 1
A = 2
[ERROR E0191] main.cz:2:1: Cannot assign to constant 'A'

E0192

Cannot assign to '*', which is declared with let

Found by the checker, as it checks statements.

let int x = 1
x = 2
[ERROR E0192] main.cz:2:1: Cannot assign to 'x', which is declared with let

E0193

'*' is a parameter or a loop variable, which a function made here gets a copy of; copy it into a variable to change it from here

Found by the checker, as it checks statements. A function written as an expression, or deferred code, can change the variables around it, but not a parameter or a loop variable, which it gets a copy of.

for i = 1 to 3 do
    defer i += 1
end
[ERROR E0193] main.cz:2:11: 'i' is a parameter or a loop variable, which a function made here gets a copy of; copy it into a variable to change it from here

E0194

'?' cannot be used in the place an assignment stores to

Found by the checker, as it checks statements.

E0195

Operator '*' is not valid for '*'*

Found by the checker, as it checks statements.

char c = 'a'
c += 'b'
[ERROR E0195] main.cz:2:3: Operator '+=' is not valid for 'char'

E0196

Strings are immutable and cannot be assigned by index

Found by the checker, as it checks statements.

str value = "abc"
value[0] = 'x'
[ERROR E0196] main.cz:2:6: Strings are immutable and cannot be assigned by index

E0197

A tuple cannot be changed; make a new one

Found by the checker, as it checks statements.

E0198

Missing return value of type '*'

Found by the checker, as it checks statements.

func f() int do
 return
end
[ERROR E0198] main.cz:2:2: Missing return value of type 'int'

E0199

Cannot return a value from a void function

Found by the checker, as it checks statements.

func f() do
 return 1
end
[ERROR E0199] main.cz:2:2: Cannot return a value from a void function

E0200

Give this function's result type, as in func(...) str do; '*' does not say it

Found by the checker, as it checks statements.

int[] r = map([1], func(n) do
 return null
end)
[ERROR E0200] main.cz:2:2: Give this function's result type, as in func(...) str do; 'null' does not say it

E0201

Cannot return '*' from function returning '*'*

Found by the checker, as it checks statements.

func f() int do
 return sqrt(2)
end
[ERROR E0201] main.cz:2:2: Cannot return 'f64' from function returning 'int'; convert it with int(...), which drops the fraction

E0202

Loop bounds must be integers

Found by the checker, as it checks statements.

for i = 0 to 1.5 do
end
[ERROR E0202] main.cz:1:1: Loop bounds must be integers

E0203

Condition must be a number or bool, got '*'

Found by the checker, as it checks statements.

if "x" then
end
[ERROR E0203] main.cz:1:4: Condition must be a number or bool, got 'str'

E0204

Cannot tell the type of this '*' value; store it in a variable with a declared type

Found by the checker, as it checks statements.

match Option.NONE do
 when SOME(v) then
  print(v)
 when NONE then
  print(0)
end
[ERROR E0204] main.cz:1:14: Cannot tell the type of this 'Option' value; store it in a variable with a declared type

E0205

Cannot match on a value of type '*'

Found by the checker, as it checks statements.

match 1.5 do
 when 1 then
  print(1)
end
[ERROR E0205] main.cz:1:7: Cannot match on a value of type 'float'

E0206

Match does not handle *

Found by the checker, as it checks statements.

match parse_int("1") do
 when OK(v) then
  print(v)
end
[ERROR E0206] main.cz:1:1: Match does not handle Result.ERROR; add them or an else

E0207

A pattern can name a constant, not the variable '*'

Found by the checker, as it checks statements.

int k = 1
match 1 do
 when k then
  print(1)
end
[ERROR E0207] main.cz:3:7: A pattern can name a constant, not the variable 'k'

E0208

Expected a member of '*'

Found by the checker, as it checks statements.

E0209

'*.*' is not a member of '*'

Found by the checker, as it checks statements.

E0210

Member '*' is already handled

Found by the checker, as it checks statements.

Result[int] r = Result.OK(1)
match r do
 when OK(n) then
  print(1)
 when OK(0) then
  print(2)
 else
end
[ERROR E0210] main.cz:5:7: Member 'Result.OK' is already handled

E0211

Expected a pattern for '*': *(...) with patterns for its fields, null, or a name

Found by the checker, as it checks statements.

struct P do
 int x
 int y
end
P p = P(1, 2)
match p do
 when 1 then
  print(1)
end
[ERROR E0211] main.cz:7:7: Expected a pattern for 'P': P(...) with patterns for its fields, null, or a name

E0212

Expected a pattern for '*', not '*'

Found by the checker, as it checks statements.

struct Q do
 int x
 int y
end
struct P do
 int x
 int y
end
P p = P(1, 2)
match p do
 when Q(x, y) then
  print(x)
end
[ERROR E0212] main.cz:11:7: Expected a pattern for 'P', not 'Q'

E0213

Every '*' is already handled

Found by the checker, as it checks statements.

struct P do
 int x
 int y
end
P p = P(1, 2)
match p do
 when P(x, y) then
  print(x)
 when P(a, b) then
  print(a)
end
[ERROR E0213] main.cz:9:7: Every 'P' is already handled

E0214

'*' already has a pattern

Found by the checker, as it checks statements.

struct P do
 int x
 int y
end
P p = P(1, 2)
match p do
 when P(x: 1, x: 2) then
  print(1)
end
[ERROR E0214] main.cz:7:15: 'x' already has a pattern

E0215

A pattern in order cannot follow one by name

Found by the checker, as it checks statements.

struct P do
 int x
 int y
end
P p = P(1, 2)
match p do
 when P(x: 1, 2) then
  print(1)
end
[ERROR E0215] main.cz:7:15: A pattern in order cannot follow one by name

E0216

A value of type '*' cannot be matched; bind a name to it and compare in a guard

Found by the checker, as it checks statements.

E0217

Expected a value of type '*'

Found by the checker, as it checks statements.

E0218

Expected a value of type '*', got '*'

Found by the checker, as it checks statements.

match "a" do
 when 1 then
  print(1)
end
[ERROR E0218] main.cz:2:7: Expected a value of type 'str', got 'int'

E0219

Value * is already handled

Found by the checker, as it checks statements.

match 1 do
 when 1, 1 then
  print(1)
end
[ERROR E0219] main.cz:2:10: Value 1 is already handled

E0220

A range matches integers or characters, not '*'

Found by the checker, as it checks statements.

match "a" do
 when "a" to "z" then
  print(1)
end
[ERROR E0220] main.cz:2:7: A range matches integers or characters, not 'str'

E0221

The range * holds no values; its start is after its end

Found by the checker, as it checks statements.

match 1 do
 when 5 to 1 then
  print(1)
end
[ERROR E0221] main.cz:2:7: The range 5 to 1 holds no values; its start is after its end

E0222

Values of the range * are already handled

Found by the checker, as it checks statements.

match 'a' do
 when 'a' to 'm', 'k' to 'z' then
  print(1)
end
[ERROR E0222] main.cz:2:19: Values of the range 'k' to 'z' are already handled

E0223

A value of type '*' is never null

Found by the checker, as it checks statements.

match 1 do
 when null then
  print(1)
end
[ERROR E0223] main.cz:2:7: A value of type 'int' is never null

E0224

Value null is already handled

Found by the checker, as it checks statements.

struct P do
 int x
 int y
end
P p = P(1, 2)
match p do
 when null then
  print(1)
 when null then
  print(2)
end
[ERROR E0224] main.cz:9:7: Value null is already handled

E0225

Expected a value of type '*', not a tuple

Found by the checker, as it checks statements.

E0226

This pattern has * items, but '*' has *

Found by the checker, as it checks statements.

E0227

A 'when' with several patterns cannot name values

Found by the checker, as it checks statements.

match 1 do
 when 1, n then
  print(1)
end
[ERROR E0227] main.cz:2:10: A 'when' with several patterns cannot name values

E0228

Cannot loop over a value of type '*'

Found by the checker, as it checks statements.

for x in 5 do
end
[ERROR E0228] main.cz:1:10: Cannot loop over a value of type 'int'

E0229

Cannot take '*' apart into * names

Found by the checker, as it checks statements.

E0230

Expression is nested too deeply

Found by the checker, as it checks expressions.

E0231

* '*' cannot be * '*': *

Found by the checker, as it checks expressions.

E0232

Unsupported expression

Found by the checker, as it checks expressions.

E0233

Integer literal is too large

Found by the checker, as it checks expressions.

print(0x8000000000000000)
[ERROR E0233] main.cz:1:7: Integer literal is too large

E0234

There is no conversion to '*'; for bool, compare, as in x != 0

Found by the checker, as it checks expressions.

print(bool(1))
[ERROR E0234] main.cz:1:7: There is no conversion to 'bool'; for bool, compare, as in x != 0

E0235

Cannot convert '*' to '*'

Found by the checker, as it checks expressions.

print(int("1"))
[ERROR E0235] main.cz:1:7: Cannot convert 'str' to 'int'

E0236

Unknown variable '*'

Found by the checker, as it checks expressions.

print(y)
[ERROR E0236] main.cz:1:7: Unknown variable 'y'

E0237

Enum '*' has no member '*'

Found by the checker, as it checks expressions.

enum A do
 X
 Y
end
print(A.Z)
[ERROR E0237] main.cz:5:9: Enum 'A' has no member 'Z'

E0238

Member '*' carries no values

Found by the checker, as it checks expressions.

enum K do
 A
end
K k = K.A(1)
[ERROR E0238] main.cz:4:9: Member 'K.A' carries no values

E0239

Member '*' needs * value(s)

Found by the checker, as it checks expressions.

E0240

Cannot tell the type of value * of *; give the variable a declared type

Found by the checker, as it checks expressions.

print(Option.SOME(null))
[ERROR E0240] main.cz:1:19: Cannot tell the type of value 1 of Option.SOME; give the variable a declared type

E0241

Value * of * expects '*', got '*'

Found by the checker, as it checks expressions.

Option[int] o = Option.SOME("x")
[ERROR E0241] main.cz:1:29: Value 1 of Option.SOME expects 'int', got 'str'

E0242

*.from_ordinal expects 1 argument(s), got *

Found by the checker, as it checks expressions.

E0243

*.from_ordinal expects an integer, not '*'

Found by the checker, as it checks expressions.

E0244

Cannot access field '*' on '*'

Found by the checker, as it checks expressions.

int n = 1
print(n.x)
[ERROR E0244] main.cz:2:9: Cannot access field 'x' on 'int'

E0245

Item * of the tuple should be '*', not '*'*

Found by the checker, as it checks expressions.

E0246

Cannot tell the type of item * of the tuple; give the variable a declared type

Found by the checker, as it checks expressions.

E0247

A tuple has no field '*'; its items are .0 to .*

Found by the checker, as it checks expressions.

E0248

'*' has * items, .0 to .*

Found by the checker, as it checks expressions.

E0249

Tuples of type '*' cannot be compared; they hold '*'

Found by the checker, as it checks expressions.

E0250

Operator '-' cannot be applied to '*'; it calls the method of interface Negate, and *

Found by the checker, as it checks expressions.

E0251

Operator '*' cannot be applied to '*'

Found by the checker, as it checks expressions.

print(-"x")
[ERROR E0251] main.cz:1:7: Operator '-' cannot be applied to 'str'

E0252

Operator '~' needs an integer, not '*'

Found by the checker, as it checks expressions.

print(~1.5)
[ERROR E0252] main.cz:1:7: Operator '~' needs an integer, not 'float'

E0253

Array and string indexes must be integers

Found by the checker, as it checks expressions.

int[] values = [1]
print(values[0.5])
[ERROR E0253] main.cz:2:13: Array and string indexes must be integers

E0254

Cannot index value of type '*'

Found by the checker, as it checks expressions.

int n = 1
print(n[0])
[ERROR E0254] main.cz:2:8: Cannot index value of type 'int'

E0255

'?' cannot be used after '*', which may not evaluate it

Found by the checker, as it checks expressions.

func f(bool b) Result[bool] do
 return Result.OK(b and parse_int("1")? > 0)
end
[ERROR E0255] main.cz:2:41: '?' cannot be used after 'and', which may not evaluate it

E0256

Values of '*' cannot be compared with '*'; use match, or derive Equal

Found by the checker, as it checks expressions.

E0257

Cannot compare '*' with '*'

Found by the checker, as it checks expressions.

print("a" == 1)
[ERROR E0257] main.cz:1:11: Cannot compare 'str' with 'int'

E0258

Cannot join an array of '*' and an array of '*'

Found by the checker, as it checks expressions.

E0259

Cannot join '*' and '*'; to_bytes turns text into bytes, and from_utf8 bytes into text

Found by the checker, as it checks expressions.

print(b"a" + "b")
[ERROR E0259] main.cz:1:12: Cannot join 'bytes' and 'str'; to_bytes turns text into bytes, and from_utf8 bytes into text

E0260

String concatenation requires two strings

Found by the checker, as it checks expressions.

print("a" + 1)
[ERROR E0260] main.cz:1:11: String concatenation requires two strings

E0261

Operator '*' cannot be applied to '*' and '*'*

Found by the checker, as it checks expressions.

print("a" - 1)
[ERROR E0261] main.cz:1:11: Operator '-' cannot be applied to 'str' and 'int'

E0262

Operator '*' needs integers, not '*' and '*'

Found by the checker, as it checks expressions.

print(1.5 << 1)
[ERROR E0262] main.cz:1:11: Operator '<<' needs integers, not 'float' and 'int'

E0263

Map keys of '*' are '*', got '*'

Found by the checker, as it checks expressions.

map[str, int] m = {1: 2}
[ERROR E0263] main.cz:1:20: Map keys of 'map[str,int]' are 'str', got 'int'

E0264

Cannot look for '*' in flags of '*'

Found by the checker, as it checks expressions.

E0265

Cannot use '*' with an array of '*'

Found by the checker, as it checks expressions.

f64[] v = [1.0]
print(1.0 in v)
[ERROR E0265] main.cz:2:11: Cannot use 'in' with an array of 'f64'

E0266

Cannot look for '*' in bytes; look for a byte or for bytes

Found by the checker, as it checks expressions.

print(1.5 in b"a")
[ERROR E0266] main.cz:1:11: Cannot look for 'float' in bytes; look for a byte or for bytes

E0267

Cannot look for '*' in a string

Found by the checker, as it checks expressions.

print(1 in "abc")
[ERROR E0267] main.cz:1:9: Cannot look for 'int' in a string

E0268

Cannot use '*' with '*'

Found by the checker, as it checks expressions.

print(1 in 2)
[ERROR E0268] main.cz:1:9: Cannot use 'in' with 'int'

E0269

Cannot store '*' in a map of '*'

Found by the checker, as it checks expressions.

map[str, int] m = {"a": "b"}
[ERROR E0269] main.cz:1:25: Cannot store 'str' in a map of 'int'

E0270

Cannot infer the type of a map literal

Found by the checker, as it checks expressions.

print({})
[ERROR E0270] main.cz:1:7: Cannot infer the type of a map literal

E0271

Map keys must be integers, characters, strings, plain enums, or types with hash and equals methods, not '*'

Found by the checker, as it checks expressions.

print({1.5: 1})
[ERROR E0271] main.cz:1:7: Map keys must be integers, characters, strings, plain enums, or types with hash and equals methods, not 'float'

E0272

Cannot store '*' in array of '*'

Found by the checker, as it checks expressions.

int[] values = []
values = ["x"]
[ERROR E0272] main.cz:2:11: Cannot store 'str' in array of 'int'

E0273

Cannot infer the type of an array literal

Found by the checker, as it checks expressions.

print([])
[ERROR E0273] main.cz:1:7: Cannot infer the type of an array literal

E0274

* mixes incompatible types '*' and '*'

Found by the checker, as it checks expressions.

print(len([1, "x"]))
[ERROR E0274] main.cz:1:15: Array literal mixes incompatible types 'int' and 'str'

E0275

Cannot infer the type of * *

Found by the checker, as it checks expressions.

E0276

This function takes * value(s), but * are expected here

Found by the checker, as it checks expressions.

func(int) int f = func(int a, int b) => a
[ERROR E0276] main.cz:1:19: This function takes 2 value(s), but 1 are expected here

E0277

Give the type of '*'; nothing here says it

Found by the checker, as it checks expressions.

print(len([func(x) => x]))
[ERROR E0277] main.cz:1:17: Give the type of 'x'; nothing here says it

E0278

This function can end without returning a value

Found by the checker, as it checks expressions.

func(int) int f = func(int x) do
 if x > 0 then
  return 1
 end
end
[ERROR E0278] main.cz:1:19: This function can end without returning a value

E0279

Give the result type of this function; null alone does not say it

Found by the checker, as it checks expressions.

E0280

This function returns '*', not '*'*

Found by the checker, as it checks expressions.

func(int) int f = func(int x) str => x
[ERROR E0280] main.cz:1:38: This function returns 'str', not 'int'

E0281

The generic function '*' cannot be a value; wrap it, as in func(x) => *(x)

Found by the checker, as it checks expressions.

func id[T](T x) T do
 return x
end
func(int) int f = id
[ERROR E0281] main.cz:4:19: The generic function 'id' cannot be a value; wrap it, as in func(x) => id(x)

E0282

The type '*' is not a value; len(*) is the number of its members

Found by the checker, as it checks expressions.

enum E do
 A
end
print(E)
[ERROR E0282] main.cz:4:7: The type 'E' is not a value; len(E) is the number of its members

E0283

Type '*' has no function '*'

Found by the checker, as it checks expressions.

E0284

The generic method '*' cannot be a value; wrap it, as in func(x) => value.*(x)

Found by the checker, as it checks expressions.

E0285

'*' is a function of the type; call it as *.*(...)

Found by the checker, as it checks expressions.

E0286

'*' has no method '*'

Found by the checker, as it checks expressions.

E0287

A value of type '*' cannot be called

Found by the checker, as it checks expressions.

E0288

This function takes * argument(s), got *

Found by the checker, as it checks expressions.

E0289

Argument * expects '*', got '*'*

Found by the checker, as it checks expressions.

func(int) int f = func(int x) => x
print(f("a"))
[ERROR E0289] main.cz:2:9: Argument 1 expects 'int', got 'str'

E0290

Argument * to * expects '*', got '*'*

Found by the checker, as it checks calls and built-in functions.

write(1)
[ERROR E0290] main.cz:1:7: Argument 1 to write expects 'str', got 'int'

E0291

Cannot look for '*' in an array of '*'

Found by the checker, as it checks calls and built-in functions.

str[] v = []
print(1 not in v)
[ERROR E0291] main.cz:2:9: Cannot look for 'int' in an array of 'str'

E0292

'*' is not a generic struct

Found by the checker, as it checks calls and built-in functions.

E0293

Interface '*' cannot be made; make a value of a type that satisfies it

Found by the checker, as it checks calls and built-in functions.

E0294

The built-in * takes no named values

Found by the checker, as it checks calls and built-in functions.

print(len(x: 1))
[ERROR E0294] main.cz:1:11: The built-in len takes no named values

E0295

A function value takes no named values

Found by the checker, as it checks calls and built-in functions.

func(int) int f = func(int x) => x
print(f(x: 1))
[ERROR E0295] main.cz:2:9: A function value takes no named values

E0296

'*' is a variable of type '*', not a function

Found by the checker, as it checks calls and built-in functions.

int n = 3
print(n(1))
[ERROR E0296] main.cz:2:7: 'n' is a variable of type 'int', not a function

E0297

Unknown function '*'

Found by the checker, as it checks calls and built-in functions.

missing(1)
[ERROR E0297] main.cz:1:1: Unknown function 'missing'

E0298

* has no parameter '*'

Found by the checker, as it checks calls and built-in functions.

func f(int a) do
end
f(b: 1)
[ERROR E0298] main.cz:3:3: f has no parameter 'b'

E0299

Values given by position must come before named ones

Found by the checker, as it checks calls and built-in functions.

func f(int a, int b = 2) do
end
f(b: 1, 2)
[ERROR E0299] main.cz:3:9: Values given by position must come before named ones

E0300

* expects * argument(s), got *

Found by the checker, as it checks calls and built-in functions.

print(min(1))
[ERROR E0300] main.cz:1:7: min expects 2 argument(s), got 1

E0301

'*' is given twice

Found by the checker, as it checks calls and built-in functions.

func f(int a, int b = 2) do
end
f(1, a: 2)
[ERROR E0301] main.cz:3:6: 'a' is given twice

E0302

* needs a value for '*'

Found by the checker, as it checks calls and built-in functions.

struct P do
 int x
end
P p = P()
[ERROR E0302] main.cz:4:7: P needs a value for 'x'

E0303

Cannot tell what * is in this call of *; give the values declared types

Found by the checker, as it checks calls and built-in functions.

func make[T]() T[] do
 return []
end
print(len(make()))
[ERROR E0303] main.cz:4:11: Cannot tell what T is in this call of make; give the values declared types

E0304

Cannot tell what * is in this *; write it, as in *[int](...)

Found by the checker, as it checks calls and built-in functions.

E0305

Struct '*' has no field '*'

Found by the checker, as it checks calls and built-in functions.

struct P do
 int x
end
P p = P(1)
print(p.y)
[ERROR E0305] main.cz:5:9: Struct 'P' has no field 'y'

E0306

* expects * value(s), got *

Found by the checker, as it checks calls and built-in functions.

E0307

Field '*' is given twice

Found by the checker, as it checks calls and built-in functions.

E0308

Field '*' of * expects '*', got '*'*

Found by the checker, as it checks calls and built-in functions.

struct P do
 int x
end
P p = P("x")
[ERROR E0308] main.cz:4:9: Field 'x' of P expects 'int', got 'str'

E0309

The default of '*' should be '*', not '*'*

Found by the checker, as it checks calls and built-in functions.

func f(int a = "x") do
end
[ERROR E0309] main.cz:1:16: The default of 'a' should be 'int', not 'str'

E0310

* expects a str path

Found by the checker, as it checks calls and built-in functions.

make_dir(1)
[ERROR E0310] main.cz:1:1: make_dir expects a str path

E0311

Cannot push '*' into array of '*'

Found by the checker, as it checks calls and built-in functions.

int[] values = []
push(values, "x")
[ERROR E0311] main.cz:2:1: Cannot push 'str' into array of 'int'

E0312

* expects an array as its first argument

Found by the checker, as it checks calls and built-in functions.

push(1, 2)
[ERROR E0312] main.cz:1:1: push expects an array as its first argument

E0313

Array indexes must be integers

Found by the checker, as it checks calls and built-in functions.

int[] a = [1]
print(remove_at(a, "x"))
[ERROR E0313] main.cz:2:20: Array indexes must be integers

E0314

Cannot insert '*' into array of '*'*

Found by the checker, as it checks calls and built-in functions.

int[] a = [1]
insert(a, 0, "x")
[ERROR E0314] main.cz:2:14: Cannot insert 'str' into array of 'int'

E0315

* expects numbers, got '*'

Found by the checker, as it checks calls and built-in functions.

print(abs("x"))
[ERROR E0315] main.cz:1:11: abs expects numbers, got 'str'

E0316

* expects integers, got '*'

Found by the checker, as it checks calls and built-in functions.

print(wrapping_add(1.5, 2))
[ERROR E0316] main.cz:1:20: wrapping_add expects integers, got 'float'

E0317

* expects a map as its first argument

Found by the checker, as it checks calls and built-in functions.

map[str, int] m = {}
print(keys(1))
[ERROR E0317] main.cz:2:7: keys expects a map as its first argument

E0318

* expects 1, 3, or 4 argument(s), got *

Found by the checker, as it checks calls and built-in functions.

print(run())
[ERROR E0318] main.cz:1:7: run expects 1, 3, or 4 argument(s), got 0

E0319

* expects a str[] command

Found by the checker, as it checks calls and built-in functions.

print(run(1))
[ERROR E0319] main.cz:1:7: run expects a str[] command

E0320

* expects str paths or null for the streams

Found by the checker, as it checks calls and built-in functions.

print(run(["a"], 1, null))
[ERROR E0320] main.cz:1:7: run expects str paths or null for the streams

E0321

Cannot hash a value of type '*'; give it a hash method, or derive it with #[derive(Hash)]

Found by the checker, as it checks calls and built-in functions.

struct P do
 int x
end
print(hash(P(1)))
[ERROR E0321] main.cz:4:7: Cannot hash a value of type 'P'; give it a hash method, or derive it with #[derive(Hash)]

E0322

Cannot tell the type of null; give the variable a declared type

Found by the checker, as it checks calls and built-in functions.

E0323

Cannot clone a '*'; give it a clone method, or derive it with #[derive(Clone)]

Found by the checker, as it checks calls and built-in functions.

struct P do
 int x
end
P q = clone(P(1))
[ERROR E0323] main.cz:4:7: Cannot clone a 'P'; give it a clone method, or derive it with #[derive(Clone)]

E0324

Embed paths must be relative

Found by the checker, as it checks calls and built-in functions.

str t = embed("/abs.txt")
[ERROR E0324] main.cz:1:15: Embed paths must be relative

E0325

Cannot find file '*' (looked for *)

Found by the checker, as it checks calls and built-in functions.

str t = embed("missing.txt")
[ERROR E0325] main.cz:1:15: Cannot find file 'missing.txt' (looked for build/tests/missing.txt)

E0326

Cannot embed '*': *

Found by the checker, as it checks calls and built-in functions.

E0327

* expects a string literal path

Found by the checker, as it checks calls and built-in functions.

str n = "x"
str t = embed(n)
[ERROR E0327] main.cz:2:9: embed expects a string literal path

E0328

Cannot find * '*' (looked for *)

Found by the checker, as it checks calls and built-in functions.

print(len(embed_dir("no_such_dir")))
[ERROR E0328] main.cz:1:21: Cannot find directory 'no_such_dir' (looked for build/tests/no_such_dir)

E0329

'*' is a directory; embed_dir embeds one

Found by the checker, as it checks calls and built-in functions.

print(len(embed_bytes(".")))
[ERROR E0329] main.cz:1:23: '.' is a directory; embed_dir embeds one

E0330

'*' is not a directory; embed_bytes embeds a file

Found by the checker, as it checks calls and built-in functions.

E0331

* must be an array of string literals

Found by the checker, as it checks calls and built-in functions.

print(len(embed_dir(".", include: "*.txt")))
[ERROR E0331] main.cz:1:35: include must be an array of string literals

E0332

A format spec is a str, not '*'

Found by the checker, as it checks calls and built-in functions.

E0333

'*' is not a format spec for a '*': *

Found by the checker, as it checks calls and built-in functions.

print(format(1, "q"))
[ERROR E0333] main.cz:1:17: 'q' is not a format spec for a 'int': the type is one of d, x, X, o, b, e, E, f, F, g, G, %, and s, and comes last

E0334

The count of decimals must be an integer

Found by the checker, as it checks calls and built-in functions.

print(to_str(1.5, 2.0))
[ERROR E0334] main.cz:1:19: The count of decimals must be an integer

E0335

Cannot print value of type '*'

Found by the checker, as it checks calls and built-in functions.

int[] v = [1]
print(v)
[ERROR E0335] main.cz:2:7: Cannot print value of type 'int[]'

E0336

'*' is for the parameters and results of C functions; in Cuarzo the text is a str

Found by the checker, as it checks types.

#![unsafe]
cstr s = "x"
[ERROR E0336] main.cz:2:1: 'cstr' is for the parameters and results of C functions; in Cuarzo the text is a str

E0337

Interface '*' asks for Self, so it can bound a type parameter, as in [T: *], but no value can have it as its type

Found by the checker, as it checks types.

E0338

Unknown type '*'

Found by the checker, as it checks types.

when false do
 struct Only do
  int x
 end
end
Only o = null
[ERROR E0338] main.cz:6:1: Unknown type 'Only'

E0339

Type '*' takes no type arguments

Found by the checker, as it checks types.

enum K do
 A
end
K[int] k = K.A
[ERROR E0339] main.cz:4:1: Type 'K' takes no type arguments

E0340

Type 'Result' needs its type arguments, as in Result[T] or Result[T, E]

Found by the checker, as it checks types.

Result r = Result.OK(1)
[ERROR E0340] main.cz:1:1: Type 'Result' needs its type arguments, as in Result[T] or Result[T, E]

E0341

Type '*' needs * type argument(s), as in *

Found by the checker, as it checks types.

map values = null
[ERROR E0341] main.cz:1:1: Type 'map' needs 2 type argument(s), as in map[K, V]

E0342

C cannot hold a '*'; use a number, bool, ptr, Handle, or c_func

Found by the checker, as it checks types.

E0343

* is '*' here, which does not satisfy '*': *

Found by the checker, as it checks interfaces.

struct P do
 int x
end
func twice[T: Add](T v) T do
 return v + v
end
print(twice(P(1)))
[ERROR E0343] main.cz:7:7: T is 'P' here, which does not satisfy 'Add': 'P' has no method func add(self, P other) P

E0344

*.* expects * argument(s), got *

Found by the checker, as it checks interfaces.

E0345

A method of an interface takes no named values

Found by the checker, as it checks interfaces.

E0346

'*' cannot be given to C; use a number, bool, cstr, wstr, ptr, Handle, or c_func

Found by the checker, as it checks calls to C and C types.

#![unsafe]
extern func f(str s) c_int
print(f("a"))
[ERROR E0346] main.cz:2:1: 'str' cannot be given to C; use a number, bool, cstr, wstr, ptr, Handle, or c_func

E0347

C cannot give a '*'; use a number, bool, cstr, wstr, ptr, Handle, or c_func

Found by the checker, as it checks calls to C and C types.

E0348

Argument * to * is written by C: give a variable after out, as in out count

Found by the checker, as it checks calls to C and C types.

#![unsafe]
extern func f(out c_int n) c_int
print(f(3))
[ERROR E0348] main.cz:3:9: Argument 1 to f is written by C: give a variable after out, as in out count

E0349

Argument * to * gives a '*', which a '*' cannot hold

Found by the checker, as it checks calls to C and C types.

E0350

Argument * to * is not an out parameter

Found by the checker, as it checks calls to C and C types.

E0351

A '*' cannot be given to the variable arguments of *

Found by the checker, as it checks calls to C and C types.

#![unsafe]
extern func printf(cstr format, ...) c_int
printf("%d", [1])
[ERROR E0351] main.cz:3:14: A 'int[]' cannot be given to the variable arguments of printf

E0352

A C function takes no named values

Found by the checker, as it checks calls to C and C types.

E0353

* needs a ptr, not '*'

Found by the checker, as it checks calls to C and C types.

E0354

* needs the type a pointer points to; this one is a ptr[void]

Found by the checker, as it checks calls to C and C types.

#![unsafe]
ptr[void] p = null
print(deref(p))
[ERROR E0354] main.cz:3:7: deref needs the type a pointer points to; this one is a ptr[void]

E0355

A C array has at least one item

Found by the checker, as it checks calls to C and C types.

E0356

A field of a C * cannot be a '*'; use a C number, bool, ptr, Handle, c_func, another C struct, or c_array

Found by the checker, as it checks calls to C and C types.

#![unsafe]
extern struct P do
 str s
end
P p = P()
[ERROR E0356] main.cz:3:2: A field of a C struct cannot be a 'str'; use a C number, bool, ptr, Handle, c_func, another C struct, or c_array

E0357

C struct '*' holds itself; hold a ptr to it instead

Found by the checker, as it checks calls to C and C types.

#![unsafe]
extern struct P do
 P inner
end
P p = P()
[ERROR E0357] main.cz:2:1: C struct 'P' holds itself; hold a ptr to it instead

E0358

C * '*' has no field '*'

Found by the checker, as it checks calls to C and C types.

#![unsafe]
extern struct P do
 c_int x
end
P p = P(z: 1)
[ERROR E0358] main.cz:5:9: C struct 'P' has no field 'z'

E0359

A C array's index is a whole number

Found by the checker, as it checks calls to C and C types.

E0360

A C array is changed an item at a time

Found by the checker, as it checks calls to C and C types.

#![unsafe]
extern struct P do
 c_array[c_int, 2] a
end
P p = P()
p.a = p.a
[ERROR E0360] main.cz:6:5: A C array is changed an item at a time

E0361

Cannot assign '*' to '*'*

Found by the checker, as it checks calls to C and C types.

int x = 1
x += 0.5
[ERROR E0361] main.cz:2:3: Cannot assign 'float' to 'int'; convert it with int(...), which drops the fraction

E0362

Operator '*' is not valid for '*'

Found by the checker, as it checks calls to C and C types.

E0363

C * '*' has * field(s)

Found by the checker, as it checks calls to C and C types.

E0364

'*' is a C array; set its items after the * is made

Found by the checker, as it checks calls to C and C types.

E0365

Field '*' expects '*', got '*'*

Found by the checker, as it checks calls to C and C types.

E0366

* takes a type, as in *(c_int)

Found by the checker, as it checks calls to C and C types.

E0367

* gives the size of a C type, not of '*'

Found by the checker, as it checks calls to C and C types.

print(size_of(str))
[ERROR E0367] main.cz:1:7: size_of gives the size of a C type, not of 'str'

E0368

An extern value cannot be a '*'; use a C number, bool, ptr, Handle, c_func, or C struct

Found by the checker, as it checks calls to C and C types.

E0369

Cannot assign to the C constant '*'

Found by the checker, as it checks calls to C and C types.

#![unsafe]
#[header("limits.h")]
extern const c_int INT_MAX
INT_MAX = 3
[ERROR E0369] main.cz:4:1: Cannot assign to the C constant 'INT_MAX'

E0370

A callback cannot give C a *; give a ptr to text C keeps

Found by the checker, as it checks calls to C and C types.

E0371

The C function * takes variable arguments, so it cannot be a c_func

Found by the checker, as it checks calls to C and C types.

E0372

The C function * has out parameters, so it cannot be a c_func

Found by the checker, as it checks calls to C and C types.

E0373

Expected *

Found by the parser, reading the shape of the code.

const int
[ERROR E0373] main.cz:1:10: Expected IDENT

E0374

#![unsafe] takes no value

Found by the parser, reading the shape of the code.

E0375

json(...) takes name: "key" and skip_if_null

Found by the parser, reading the shape of the code.

struct P do
 #[json(nam: "x")]
 int x
end
[ERROR E0375] main.cz:2:9: json(...) takes name: "key" and skip_if_null

E0376

derive(...) needs what to derive, as in derive(Equal, ToText)

Found by the parser, reading the shape of the code.

E0377

derive takes *

Found by the parser, reading the shape of the code.

#[derive(Nope)]
struct P do
 int x
end
[ERROR E0377] main.cz:1:10: derive takes Equal, Hash, Clone, ToText, Default, Json

E0378

extern declarations are only allowed at the top level

Found by the parser, reading the shape of the code.

E0379

defer takes a call, an assignment, or do ... end

Found by the parser, reading the shape of the code.

func f() do
 defer int x = 1
end
[ERROR E0379] main.cz:2:8: defer takes a call, an assignment, or do ... end

E0380

extern declarations need the module marked #![unsafe] at its top

Found by the parser, reading the shape of the code.

extern func f() c_int
[ERROR E0380] main.cz:1:1: extern declarations need the module marked #![unsafe] at its top

E0381

#[*] takes a string, as in #[*("name")]

Found by the parser, reading the shape of the code.

#![unsafe]
#[header(3)]
extern struct P do
 c_int x
end
[ERROR E0381] main.cz:3:8: #[header] takes a string, as in #[header("name")]

E0382

-D * cannot set a constant of type '*'; only bool, numbers, char, and str can be set

Found by the parser, reading the shape of the code.

E0383

-D *=*: '*' is '*', so give *

Found by the parser, reading the shape of the code.

E0384

#[flags] is for enums

Found by the parser, reading the shape of the code.

#[flags]
struct P do
 int x
end
[ERROR E0384] main.cz:1:3: #[flags] is for enums

E0385

derive(Json) writes code that uses std/json; import "std/json"

Found by the parser, reading the shape of the code.

#[derive(Json)]
struct P do
 int x
end
[ERROR E0385] main.cz:1:10: derive(Json) writes code that uses std/json; import "std/json"

E0386

Expected ')' in the condition

Found by the parser, reading a compile-time condition.

when (true do
end
[ERROR E0386] main.cz:1:12: Expected ')' in the condition

E0387

Expected platform(...), arch(...), or defined(...) in a 'when' condition

Found by the parser, reading a compile-time condition.

when foo("x") do
end
[ERROR E0387] main.cz:1:6: Expected platform(...), arch(...), or defined(...) in a 'when' condition

E0388

Expected ')' after the argument of *

Found by the parser, reading a compile-time condition.

when platform("linux" do
end
[ERROR E0388] main.cz:1:23: Expected ')' after the argument of platform

E0389

defined(...) takes the name of a build constant, as in defined(DEBUG)

Found by the parser, reading a compile-time condition.

when defined("X") do
end
[ERROR E0389] main.cz:1:14: defined(...) takes the name of a build constant, as in defined(DEBUG)

E0390

Unknown platform; expected one of *

Found by the parser, reading a compile-time condition.

when platform("windos") do
end
[ERROR E0390] main.cz:1:15: Unknown platform; expected one of "linux", "macos", "windows", "freebsd", "openbsd", "wasi"

E0391

Unknown processor; expected one of *

Found by the parser, reading a compile-time condition.

when arch("sparc") do
end
[ERROR E0391] main.cz:1:11: Unknown processor; expected one of "x86_64", "arm64", "wasm32"

E0392

-D needs a name, as in -D DEBUG=true, not '*'

Found by the parser, reading a compile-time condition.

E0393

derive(Default) has no value for a field of type '*'; give the field a default

Found by the parser, writing the methods of #[derive(...)].

#[derive(Default)]
struct P do
 func(int) f
end
[ERROR E0393] main.cz:1:10: derive(Default) has no value for a field of type 'func(int)'; give the field a default

E0394

derive(Json) cannot write a field of type '*'

Found by the parser, writing the methods of #[derive(...)].

import "std/json"
#[derive(Json)]
struct P do
 (int, int) pair
end
[ERROR E0394] main.cz:2:10: derive(Json) cannot write a field of type '(int,int)'

E0395

derive(Json) cannot read a field of type '*'

Found by the parser, writing the methods of #[derive(...)].

E0396

Member '*' carries * value(s), got *

Found by the checker, as it checks statements.

E0397

Member '*' carries no value '*'

Found by the checker, as it checks statements.

Result[int] r = Result.OK(1)
match r do
 when OK(size: n) then
  print(1)
 else
end
[ERROR E0397] main.cz:3:10: Member 'Result.OK' carries no value 'size'

E0398

Struct '*' has * field(s), got *

Found by the checker, as it checks statements.

struct P do
 int x
 int y
end
P p = P(1, 2)
match p do
 when P(1) then
  print(1)
end
[ERROR E0398] main.cz:7:7: Struct 'P' has 2 field(s), got 1

E0399

* expects an array, got '*'

Found by the checker, as it checks calls and built-in functions.

reserve(5, 1)
[ERROR E0399] main.cz:1:9: reserve expects an array, got 'int'

E0400

* needs an integer count

Found by the checker, as it checks calls and built-in functions.

int[] a = []
reserve(a, 1.5)
[ERROR E0400] main.cz:2:12: reserve needs an integer count

E0401

* expects an array or bytes, got '*'

Found by the checker, as it checks calls and built-in functions.

print(count(5, 1))
[ERROR E0401] main.cz:1:13: count expects an array or bytes, got 'int'

E0402

* cannot search an array of '*'

Found by the checker, as it checks calls and built-in functions.

f64[] a = [1.5]
print(find(a, 1.5))
[ERROR E0402] main.cz:2:7: find cannot search an array of 'f64'

E0403

* expects a str text and a str part, bytes and bytes, or an array and a value

Found by the checker, as it checks calls and built-in functions.

print(find("a", 'a'))
[ERROR E0403] main.cz:1:7: find expects a str text and a str part, bytes and bytes, or an array and a value

E0404

* start must be an integer

Found by the checker, as it checks calls and built-in functions.

print(find("a", "a", "0"))
[ERROR E0404] main.cz:1:7: find start must be an integer

E0405

await needs a Task, not '*'

Found by the checker, as it checks calls and built-in functions.

int x = await 5
[ERROR E0405] main.cz:1:9: await needs a Task, not 'int'

E0406

* expects a plain enum, not '*'

Found by the checker, as it checks calls and built-in functions.

E0407

* expects an integer status

Found by the checker, as it checks calls and built-in functions.

exit(1.5)
[ERROR E0407] main.cz:1:1: exit expects an integer status

E0408

* expects a string, bytes, an array, or a map

Found by the checker, as it checks calls and built-in functions.

print(len(1))
[ERROR E0408] main.cz:1:7: len expects a string, bytes, an array, or a map

E0409

* expects an array

Found by the checker, as it checks calls and built-in functions.

pop(1)
[ERROR E0409] main.cz:1:1: pop expects an array

E0410

* expects a string, bytes, or an array as its first argument

Found by the checker, as it checks calls and built-in functions.

print(slice(1, 0, 1))
[ERROR E0410] main.cz:1:7: slice expects a string, bytes, or an array as its first argument

E0411

* bounds must be integers

Found by the checker, as it checks calls and built-in functions.

print(slice("abc", 0, 1.5))
[ERROR E0411] main.cz:1:7: slice bounds must be integers

E0412

* expects a str[] and a str separator

Found by the checker, as it checks calls and built-in functions.

str[] x = []
print(join(x, 1))
[ERROR E0412] main.cz:2:7: join expects a str[] and a str separator

E0413

* needs a default of type '*', got '*'

Found by the checker, as it checks calls and built-in functions.

map[str, int] m = {}
print(get(m, "a", "b"))
[ERROR E0413] main.cz:2:19: get needs a default of type 'int', got 'str'

E0414

* takes its options by name: *

Found by the checker, as it checks calls and built-in functions.

E0415

* must be true or false

Found by the checker, as it checks calls and built-in functions.

print(len(embed_dir(".", compress: 1)))
[ERROR E0415] main.cz:1:36: compress must be true or false

E0416

* has no option '*'; *

Found by the checker, as it checks calls and built-in functions.

print(len(embed_dir(".", level: 3)))
[ERROR E0416] main.cz:1:26: embed_dir has no option 'level'; it has compress, include, and exclude

E0417

* cannot convert '*' to text

Found by the checker, as it checks calls and built-in functions.

E0418

'.' needs a precision after it

Found by the checker, as it checks calls and built-in functions.

E0419

text takes only the type s

Found by the checker, as it checks calls and built-in functions.

E0420

text takes no sign, #, 0, grouping, or =

Found by the checker, as it checks calls and built-in functions.

E0421

a whole number takes no precision

Found by the checker, as it checks calls and built-in functions.

E0422

* with decimals needs a number, not '*'

Found by the checker, as it checks calls and built-in functions.

print(to_str("a", 2))
[ERROR E0422] main.cz:1:14: to_str with decimals needs a number, not 'str'

E0423

* cannot convert '*'

Found by the checker, as it checks calls and built-in functions.

print(f"{[1]}")
[ERROR E0423] main.cz:1:10: to_str cannot convert 'int[]'

E0424

* needs a whole number of items

Found by the checker, as it checks calls to C and C types.

E0425

* gives where the data of bytes, an array of C values, or a C struct is, not of a '*'

Found by the checker, as it checks calls to C and C types.

E0426

* gives the pointer type wanted where it is used, as in *

Found by the checker, as it checks calls to C and C types.

#![unsafe]
print(ptr_cast(null))
[ERROR E0426] main.cz:2:7: ptr_cast gives the pointer type wanted where it is used, as in ptr[c_int] p = ptr_cast(q)

E0427

* needs a pointer, a Handle, or a c_func, not '*'

Found by the checker, as it checks calls to C and C types.

E0428

* needs the Handle keep_alive gave, not a '*'

Found by the checker, as it checks calls to C and C types.

E0429

* gives the type wanted where it is used, as in *

Found by the checker, as it checks calls to C and C types.

#![unsafe]
struct B do
 int x
end
Handle h = keep_alive(B(1))
print(kept(h))
[ERROR E0429] main.cz:6:7: kept gives the type wanted where it is used, as in Window w = kept(handle)

E0430

* gives the c_func type wanted where it is used, as in *

Found by the checker, as it checks calls to C and C types.

#![unsafe]
print(c_callback(func() do
end))
[ERROR E0430] main.cz:2:7: c_callback gives the c_func type wanted where it is used, as in c_func(c_int) c_int f = c_callback(...)

E0431

* needs a '*' for a '*', not a '*'

Found by the checker, as it checks calls to C and C types.

#![unsafe]
c_func(c_int) c_int f = c_callback(func(str s) c_int do
 return 1
end)
[ERROR E0431] main.cz:2:36: c_callback needs a 'func(i32)i32' for a 'c_func(i32)i32', not a 'func(str)i32'

E0432

* needs the c_func c_callback gave, not a '*'

Found by the checker, as it checks calls to C and C types.

E0433

* keeps a value the collector frees, not a '*'

Found by the checker, as it checks calls to C and C types.

#![unsafe]
Handle h = keep_alive(3)
[ERROR E0433] main.cz:2:23: keep_alive keeps a value the collector frees, not a 'int'

E0434

* is not valid TOML: *

Found by the project reader, reading cuarzo.toml.

[project]
name = "notes"
name = "jots"
[ERROR E0434] cuarzo.toml:3:1: cuarzo.toml is not valid TOML: key 'name' is given twice

E0435

Unknown key '*' in *

Found by the project reader, reading cuarzo.toml. A key the manifest does not have is reported, so a misspelled one is not ignored.

[project]
name = "notes"

[[program]]
mian = "src/notes.cz"
[ERROR E0435] cuarzo.toml:5:1: Unknown key 'mian' in [[program]]; did you mean 'main'?

E0436

'*' must be *

Found by the project reader, reading cuarzo.toml. A value is not of the kind its key takes: text, a boolean, an array, a table, a version, a name, or a .cz file.

[project]
name = "notes"
version = 1
[ERROR E0436] cuarzo.toml:3:1: 'project.version' must be text, not a number

E0437

* needs '*'

Found by the project reader, reading cuarzo.toml. A table lacks a key it must have: the project's name, or the main file of a program or library.

[project]
name = "notes"

[[program]]
name = "notes"
[ERROR E0437] cuarzo.toml:4:1: A program needs 'main', the file it starts in

E0438

No file '*' for *

Found by the project reader, reading cuarzo.toml. Paths are from the folder of cuarzo.toml.

[project]
name = "notes"

[[program]]
main = "src/note.cz"
[ERROR E0438] cuarzo.toml:5:1: No file 'src/note.cz' for the program 'note'

E0439

Unknown platform '*' in '*'; expected one of *

Found by the project reader, reading cuarzo.toml.

[project]
name = "notes"
platforms = ["linux", "mac"]
[ERROR E0439] cuarzo.toml:3:1: Unknown platform 'mac' in 'project.platforms'; expected one of linux, macos, windows, freebsd, openbsd, wasi

E0440

'*' names *

Found by the project reader, reading cuarzo.toml. A name chooses what cuarzo build <name> builds and cuarzo run <name> runs, so programs, libraries, and commands each have their own.

[project]
name = "notes"

[[program]]
main = "src/notes.cz"

[commands]
notes = "build/notes --help"
[ERROR E0440] cuarzo.toml:8:1: 'notes' names both a program and a command

E0441

Unknown option '*' in profile '*'

Found by the project reader, reading cuarzo.toml. A profile takes the options of the command line that change how a program is built: --optimize, --release, --debug, --no-gc, --mem-stats, --gc-stress, --check-overflow, --max-memory, and --build-version.

[project]
name = "notes"

[profile.debug]
options = ["--check-overflows"]
[ERROR E0441] cuarzo.toml:5:1: Unknown option '--check-overflows' in profile 'debug'; did you mean '--check-overflow'?

E0442

Option '*' in profile '*' needs a value after it

Found by the project reader, reading cuarzo.toml.

[project]
name = "notes"

[profile.debug]
options = ["--max-memory"]
[ERROR E0442] cuarzo.toml:5:1: Option '--max-memory' in profile 'debug' needs a value after it

E0443

Define '*' in profile '*' is not a name

Found by the project reader, reading cuarzo.toml. A define sets a build constant, as -D does, so its key is a name of letters, digits, and _ that does not start with a digit.

[project]
name = "notes"

[profile.debug]
defines = { "log-level" = "debug" }
[ERROR E0443] cuarzo.toml:5:1: Define 'log-level' in profile 'debug' is not a name

E0444

The project has no * named '*'

Found as a command uses the project.

[ERROR E0444] The project has no program or command named 'nots'; did you mean 'notes'?

E0445

The * '*' is not for *; it is for *

Found as a command uses the project. A program or library that names its platforms is built and run only on them.

[ERROR E0445] The program 'notes' is not for windows; it is for linux and macos

E0446

No file was given, and there is no cuarzo.toml in this folder or the folders above it

Found as a command uses the project. cuarzo build, run, and check without a file work on the project of the current folder.

[ERROR E0446] No file was given, and there is no cuarzo.toml in this folder or the folders above it

E0447

The project has nothing to *

Found as a command uses the project.

[ERROR E0447] The project has nothing to run: cuarzo.toml has no [[program]]

E0448

'*' is a library, which cannot be run

Found as a command uses the project. cuarzo check <name> checks a library.

[ERROR E0448] 'shapes' is a library, which cannot be run

E0449

Cannot run the command '*': there is no program '*'

Found as a command uses the project. The first word of a command is a program on the PATH, or a path from the folder of cuarzo.toml.

[ERROR E0449] Cannot run the command 'serve': there is no program 'build/notes'

E0450

Unknown format '*' in '*'

Found by the project reader, reading cuarzo.toml, and by cuarzo bundle --format. The formats are app, dmg, folder, msi, nsis, msix, deb, rpm, appimage, and flatpak; a misspelled one gets a suggestion.

[bundle]
identifier = "com.example.notes"
formats = ["dmgg"]
[ERROR E0450] cuarzo.toml:3:1: Unknown format 'dmgg' in 'bundle.formats'; did you mean 'dmg'?

E0451

Unknown category '*' in '*'

Found by the project reader, reading cuarzo.toml. The categories are developer-tools, education, entertainment, finance, games, graphics, music, network, productivity, science, utilities, and video; each system is told its own name for the one chosen.

[bundle]
identifier = "com.example.notes"
category = "productivty"
[ERROR E0451] cuarzo.toml:3:1: Unknown category 'productivty' in 'bundle.category'; did you mean 'productivity'?

E0452

There is no cuarzo.toml in * or the folders above it, so there is nothing to bundle

Found as cuarzo bundle starts. It bundles the project of the folder it is given, or of the current folder.

[ERROR E0452] There is no cuarzo.toml in tools or the folders above it, so there is nothing to bundle

E0453

* is already there; cuarzo ci --force writes it again

Found as cuarzo ci starts. It does not replace a workflow that may have been changed by hand.

[ERROR E0453] .github/workflows/release.yml is already there; cuarzo ci --force writes it again

E0454

'*' says it satisfies '*', but *

Found by the checker. A struct or an enum that says it satisfies an interface, as in struct Circle: Shape, must have each of its methods, with the same parameter and result types.

interface Shape do
    func area(self) f64
end
struct Square: Shape do
    f64 side
end
[ERROR E0454] main.cz:4:1: 'Square' says it satisfies 'Shape', but 'Square' has no method func area(self) f64

E0455

'*' says it satisfies '*', which is not an interface

Found by the checker. What follows the : after a struct's or an enum's name are interfaces.

struct Point do
    int x
end
struct Pixel: Point do
    int color
end
[ERROR E0455] main.cz:4:1: 'Pixel' says it satisfies 'Point', which is not an interface

E0456

The number * does not fit in a '*', which holds * to *

Found by the checker, as it checks expressions. A number written where an integer type narrower than int is expected must fit it; a value that is not written as a number wraps around instead.

u8 level = 300
[ERROR E0456] main.cz:1:12: The number 300 does not fit in a 'u8', which holds 0 to 255

Warnings

What cuarzo lint and editors report about valid code. Lint looks at the program's own files, not the standard library's.

W0001

Variable '*' is never used

A variable is declared, and nothing reads or sets it afterwards. Remove it, or start its name with _ if it must be there. The fix renames it.

func area(int w, int h) int do
    int unused = 3
    return w * h
end

W0002

Parameter '*' is never used

A private function, not a method and never used as a function value, does not use one of its parameters. The fix renames it to start with _.

W0003

Nothing uses the module imported from '*'

No name the file uses is declared in the module, or, for an import with as, its name is never written. An import with pub passes the module on and is always used. The fix removes the import.

W0004

Function '*' is never used

A private function that nothing in its file calls or uses as a value. The fix removes it.

W0005

This code never runs

Code after a return, break, or continue, or after a call to panic or exit, in the same block. The fix removes it.

while true do
    break
    print("never")
end

W0006

'*' hides the variable of the same name declared at *

A variable declared inside a block has the name of one outside it, which the block can then no longer use; a mistake when the outer one was meant.

W0007

'*' is set but its value is never read

A variable is given values, and none of them is ever read.

W0008

'*' is assigned to itself

x = x changes nothing; the variable meant was likely another. The fix removes the assignment.

W0009

'*' is compared with itself, so the result is always the same

A comparison of a name, or of a field of it, with itself is always true or always false.

W0010

'*' needs no 'shared': a variable that a closure changes is shared with it on its own

Inside a function, a variable that a closure or deferred code changes, or that a closure in its own first value uses, is kept where both see the same variable, without shared. The fix takes the word away. shared stays for variables at the top level of a file, which every function of the module can change.

func counter() func() int do
    shared int n = 0
    return func() do
        n += 1
        return n
    end
end