checker: cleanup - remove unused c.using_new_err_struct (#25036)

This commit is contained in:
Felipe Pena 2025-08-04 02:40:19 -03:00 committed by GitHub
parent 1569a821cd
commit 3b7ada1621
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -125,7 +125,6 @@ mut:
match_exhaustive_cutoff_limit int = 10 match_exhaustive_cutoff_limit int = 10
is_last_stmt bool is_last_stmt bool
prevent_sum_type_unwrapping_once bool // needed for assign new values to sum type, stopping unwrapping then prevent_sum_type_unwrapping_once bool // needed for assign new values to sum type, stopping unwrapping then
using_new_err_struct bool
need_recheck_generic_fns bool // need recheck generic fns because there are cascaded nested generic fn need_recheck_generic_fns bool // need recheck generic fns because there are cascaded nested generic fn
generic_fns map[string]bool // register generic fns that needs recheck once generic_fns map[string]bool // register generic fns that needs recheck once
inside_sql bool // to handle sql table fields pseudo variables inside_sql bool // to handle sql table fields pseudo variables
@ -205,7 +204,6 @@ fn (mut c Checker) reset_checker_state_at_start_of_new_file() {
c.cur_orm_ts = ast.TypeSymbol{} c.cur_orm_ts = ast.TypeSymbol{}
c.prevent_sum_type_unwrapping_once = false c.prevent_sum_type_unwrapping_once = false
c.loop_labels = [] c.loop_labels = []
c.using_new_err_struct = false
c.inside_selector_expr = false c.inside_selector_expr = false
c.inside_interface_deref = false c.inside_interface_deref = false
c.inside_decl_rhs = false c.inside_decl_rhs = false
@ -1610,12 +1608,6 @@ fn (mut c Checker) selector_expr(mut node ast.SelectorExpr) ast.Type {
prevent_sum_type_unwrapping_once := c.prevent_sum_type_unwrapping_once prevent_sum_type_unwrapping_once := c.prevent_sum_type_unwrapping_once
c.prevent_sum_type_unwrapping_once = false c.prevent_sum_type_unwrapping_once = false
using_new_err_struct_save := c.using_new_err_struct
// TODO: remove; this avoids a breaking change in syntax
if node.expr is ast.Ident && node.expr.name == 'err' {
c.using_new_err_struct = true
}
// T.name, typeof(expr).name // T.name, typeof(expr).name
mut name_type := 0 mut name_type := 0
mut node_expr := node.expr mut node_expr := node.expr
@ -1683,7 +1675,6 @@ fn (mut c Checker) selector_expr(mut node ast.SelectorExpr) ast.Type {
} }
} }
c.inside_selector_expr = old_selector_expr c.inside_selector_expr = old_selector_expr
c.using_new_err_struct = using_new_err_struct_save
if typ == ast.void_type_idx { if typ == ast.void_type_idx {
// This means that the field has an undefined type. // This means that the field has an undefined type.
// This error was handled before. // This error was handled before.