fn new_checker(table &table.Table, pref &pref.Preferences) Checker
struct Checker {
pref &pref.Preferences
pub mut:
table &table.Table
file &ast.File = 0
nr_errors int
nr_warnings int
errors []errors.Error
warnings []errors.Warning
error_lines []int
expected_type table.Type
expected_or_type table.Type
cur_fn &ast.FnDecl
const_decl string
const_deps []string
const_names []string
global_names []string
locked_names []string
rlocked_names []string
in_for_count int
returns bool
scope_returns bool
mod string
is_builtin_mod bool
inside_unsafe bool
inside_const bool
skip_flags bool
cur_generic_types []table.Type
mut:
expr_level int
inside_sql bool
cur_orm_ts table.TypeSymbol
error_details []string
for_in_mut_val_name string
vmod_file_content string
vweb_gen_types []table.Type
prevent_sum_type_unwrapping_once bool
loop_label string
timers &util.Timers = util.new_timers(false)
comptime_fields_type map[string]table.Type
fn_scope &ast.Scope = voidptr(0)
}
fn (mut c Checker) add_error_detail(s string)
call this before calling error or warn
fn (mut c Checker) array_init(mut array_init ast.ArrayInit) table.Type
fn (mut c Checker) assign_stmt(mut assign_stmt ast.AssignStmt)
fn (mut c Checker) call_expr(mut call_expr ast.CallExpr) table.Type
fn (mut c Checker) call_fn(mut call_expr ast.CallExpr) table.Type
fn (mut c Checker) call_method(mut call_expr ast.CallExpr) table.Type
fn (mut c Checker) cast_expr(mut node ast.CastExpr) table.Type
fn (mut c Checker) chan_init(mut node ast.ChanInit) table.Type
fn (mut c Checker) check(ast_file &ast.File)
fn (mut c Checker) check2(ast_file &ast.File) []errors.Error
not used right now
fn (mut c Checker) check_basic(got table.Type, expected table.Type) bool
fn (mut c Checker) check_dup_keys(node &ast.MapInit, i int)
fn (mut c Checker) check_expected(got table.Type, expected table.Type) ?
fn (mut c Checker) check_expected_call_arg(got table.Type, expected_ table.Type) ?
fn (mut c Checker) check_expr_opt_call(expr ast.Expr, ret_type table.Type) table.Type
return the actual type of the expression, once the optional is handled
fn (mut c Checker) check_files(ast_files []ast.File)
fn (mut c Checker) check_matching_function_symbols(got_type_sym &table.TypeSymbol, exp_type_sym &table.TypeSymbol) bool
fn (mut c Checker) check_or_expr(or_expr ast.OrExpr, ret_type table.Type, expr_return_type table.Type)
fn (mut c Checker) check_scope_vars(sc &ast.Scope)
fn (mut c Checker) check_types(got table.Type, expected table.Type) bool
TODO: promote(), check_types(), symmetric_check() and check() overlap - should be rearranged
fn (mut c Checker) concat_expr(mut concat_expr ast.ConcatExpr) table.Type
fn (mut c Checker) const_decl(mut node ast.ConstDecl)
fn (mut c Checker) enum_decl(decl ast.EnumDecl)
fn (mut c Checker) enum_val(mut node ast.EnumVal) table.Type
.green
or Color.green
If a short form is used, expected_type
needs to be an enum with this value.
fn (mut c Checker) error(message string, pos token.Position)
fn (mut c Checker) expr(node ast.Expr) table.Type
TODO node must be mut
fn (c &Checker) get_default_fmt(ftyp table.Type, typ table.Type) byte
fn (mut c Checker) ident(mut ident ast.Ident) table.Type
fn (mut c Checker) if_expr(mut node ast.IfExpr) table.Type
fn (mut c Checker) index_expr(mut node ast.IndexExpr) table.Type
fn (mut c Checker) infer_fn_types(f table.Fn, mut call_expr ast.CallExpr)
fn (mut c Checker) infix_expr(mut infix_expr ast.InfixExpr) table.Type
fn (mut c Checker) interface_decl(decl ast.InterfaceDecl)
fn (mut c Checker) lock_expr(mut node ast.LockExpr) table.Type
fn (mut c Checker) map_init(mut node ast.MapInit) table.Type
fn (mut c Checker) match_expr(mut node ast.MatchExpr) table.Type
fn (mut c Checker) postfix_expr(mut node ast.PostfixExpr) table.Type
fn (mut c Checker) prefix_expr(mut node ast.PrefixExpr) table.Type
fn (c &Checker) promote(left_type table.Type, right_type table.Type) table.Type
fn (mut c Checker) return_stmt(mut return_stmt ast.Return)
TODO: non deferred
fn (mut c Checker) select_expr(mut node ast.SelectExpr) table.Type
fn (mut c Checker) selector_expr(mut selector_expr ast.SelectorExpr) table.Type
fn (mut c Checker) string_inter_lit(mut node ast.StringInterLiteral) table.Type
fn (mut c Checker) struct_decl(mut decl ast.StructDecl)
fn (mut c Checker) struct_init(mut struct_init ast.StructInit) table.Type
fn (mut c Checker) symmetric_check(left table.Type, right table.Type) bool
fn (mut c Checker) type_decl(node ast.TypeDecl)
fn (mut c Checker) unsafe_expr(mut node ast.UnsafeExpr) table.Type
fn (c &Checker) unwrap_generic(typ table.Type) table.Type
fn (mut c Checker) warn(s string, pos token.Position)