@@ -613,15 +613,15 @@ fn (b &Builder) is_module_call_receiver(name string) bool {
613613 }
614614 if b.env != unsafe { nil } {
615615 if scope_ref := b.env.get_scope (b.cur_module) {
616- mut scope := scope_ref
616+ mut scope := unsafe { scope_ref }
617617 if obj := scope.lookup_parent (name, 0 ) {
618618 if obj is types.Module {
619619 return true
620620 }
621621 }
622622 }
623623 if scope_ref := b.env.get_scope ('builtin' ) {
624- mut scope := scope_ref
624+ mut scope := unsafe { scope_ref }
625625 if obj := scope.lookup_parent (name, 0 ) {
626626 if obj is types.Module {
627627 return true
@@ -645,7 +645,7 @@ fn (b &Builder) is_known_c_symbol_name(name string) bool {
645645 }
646646 if b.env != unsafe { nil } {
647647 if scope_ref := b.env.get_scope ('C' ) {
648- mut scope := scope_ref
648+ mut scope := unsafe { scope_ref }
649649 if _ := scope.lookup_parent (name, 0 ) {
650650 return true
651651 }
@@ -3460,9 +3460,9 @@ fn (b &Builder) lookup_type_in_scope(name string, module_name string) ?types.Typ
34603460 }
34613461 mut scope := & types.Scope (unsafe { nil })
34623462 if s := b.env.get_scope (module_name) {
3463- scope = s
3463+ scope = unsafe { s }
34643464 } else if s := b.env.get_scope ('builtin' ) {
3465- scope = s
3465+ scope = unsafe { s }
34663466 } else {
34673467 return none
34683468 }
@@ -3506,23 +3506,23 @@ fn (b &Builder) lookup_var_type_from_env(name string) ?types.Type {
35063506 mut fn_scope := & types.Scope (unsafe { nil })
35073507 mut found_fn_scope := false
35083508 if s := b.env.get_fn_scope_by_key (fn_name) {
3509- fn_scope = s
3509+ fn_scope = unsafe { s }
35103510 found_fn_scope = true
35113511 } else if s := b.env.get_fn_scope (b.cur_module, fn_name) {
3512- fn_scope = s
3512+ fn_scope = unsafe { s }
35133513 found_fn_scope = true
35143514 } else if sep := fn_name.index ('__' ) {
35153515 module_name := fn_name[..sep]
35163516 base_name := fn_name[sep + 2 ..]
35173517 if s := b.env.get_fn_scope (module_name, base_name) {
3518- fn_scope = s
3518+ fn_scope = unsafe { s }
35193519 found_fn_scope = true
35203520 } else if module_name != b.cur_module {
35213521 // Method names may use a different module prefix than the
35223522 // checker's scope key (e.g. strings__Builder__method vs
35233523 // main__Builder__method). Retry with the current module.
35243524 if s2 := b.env.get_fn_scope (b.cur_module, base_name) {
3525- fn_scope = s 2
3525+ fn_scope = unsafe { s 2 }
35263526 found_fn_scope = true
35273527 }
35283528 }
@@ -3535,9 +3535,9 @@ fn (b &Builder) lookup_var_type_from_env(name string) ?types.Type {
35353535 }
35363536 mut scope := & types.Scope (unsafe { nil })
35373537 if s := b.env.get_scope (b.cur_module) {
3538- scope = s
3538+ scope = unsafe { s }
35393539 } else if s := b.env.get_scope ('builtin' ) {
3540- scope = s
3540+ scope = unsafe { s }
35413541 } else {
35423542 return none
35433543 }
@@ -3641,7 +3641,7 @@ fn (mut b Builder) infer_expr_raw_type(expr ast.Expr) ?types.Type {
36413641 }
36423642 if b.env != unsafe { nil } {
36433643 if scope_ref := b.env.get_scope (lhs_ident.name) {
3644- mut scope := scope_ref
3644+ mut scope := unsafe { scope_ref }
36453645 if obj := scope.lookup_parent (base.rhs.name, 0 ) {
36463646 return obj.typ ()
36473647 }
@@ -4910,7 +4910,7 @@ fn (mut b Builder) try_eval_const_expr_i64(expr ast.Expr) ?i64 {
49104910 }
49114911 }
49124912 .left_shift {
4913- lhs << rhs
4913+ unsafe { lhs << rhs }
49144914 }
49154915 .right_shift {
49164916 lhs >> rhs
@@ -5277,7 +5277,7 @@ fn (mut b Builder) infer_array_elem_type_from_base_expr(expr ast.Expr) ?TypeID {
52775277 // Module-qualified globals/constants (e.g. os.args).
52785278 if b.env != unsafe { nil } {
52795279 if scope_ref := b.env.get_scope (lhs_ident.name) {
5280- mut scope := scope_ref
5280+ mut scope := unsafe { scope_ref }
52815281 if obj := scope.lookup_parent (base.rhs.name, 0 ) {
52825282 if elem_t := b.array_elem_type_from_types_type (obj.typ ()) {
52835283 return elem_t
@@ -12991,7 +12991,7 @@ fn (mut b Builder) eval_const_expr(expr ast.Expr) i64 {
1299112991 }
1299212992 }
1299312993 .left_shift {
12994- lhs << rhs
12994+ unsafe { lhs << rhs }
1299512995 }
1299612996 .right_shift {
1299712997 lhs >> rhs
0 commit comments