File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ const _k = [
3838fn block_generic (mut dig Digest, p_ []u8 ) {
3939 unsafe {
4040 mut p := p_
41- mut w := []u64 {len: ( 80 ) }
41+ mut w := [80 ]u64 {}
4242 mut h0 := dig.h[0 ]
4343 mut h1 := dig.h[1 ]
4444 mut h2 := dig.h[2 ]
Original file line number Diff line number Diff line change @@ -6514,6 +6514,9 @@ fn (mut c Checker) prefix_expr(mut node ast.PrefixExpr) ast.Type {
65146514 if right_type.is_ptr () {
65156515 return right_type.deref ()
65166516 }
6517+ if expr.is_auto_deref_var () {
6518+ return right_type
6519+ }
65176520 if ! right_type.is_pointer () && ! c.pref.translated && ! c.file.is_translated {
65186521 s := c.table.type_to_str (right_type)
65196522 c.error ('invalid indirect of `${s} `, the type `${right_sym.name} ` is not a pointer' ,
Original file line number Diff line number Diff line change @@ -1107,7 +1107,11 @@ fn (mut g Gen) assign_stmt(node_ ast.AssignStmt) {
11071107 if left_sym.kind == .function {
11081108 g.write ('{void* _ = ' )
11091109 } else {
1110- g.write ('{${styp} _ = ' )
1110+ mut actual_styp := styp
1111+ if val is ast.Ident && val.is_auto_deref_var () {
1112+ actual_styp = '${styp} *'
1113+ }
1114+ g.write ('{${actual_styp} _ = ' )
11111115 }
11121116 if (val in [ast.MatchExpr, ast.IfExpr, ast.ComptimeSelector] || is_fixed_array_var)
11131117 && unaliased_right_sym.info is ast.ArrayFixed {
You can’t perform that action at this time.
0 commit comments