1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

v.ast: change 'type.to_ptr()' to 'type.ref()' (#12086)

This commit is contained in:
yuyi
2021-10-07 01:49:39 +08:00
committed by GitHub
parent 77c18f4435
commit f1742a6f62
7 changed files with 25 additions and 25 deletions

View File

@@ -629,7 +629,7 @@ fn (mut p Parser) prefix_expr() ast.Expr {
}
fn (mut p Parser) recast_as_pointer(mut cast_expr ast.CastExpr, pos token.Position) {
cast_expr.typ = cast_expr.typ.to_ptr()
cast_expr.typ = cast_expr.typ.ref()
cast_expr.typname = p.table.get_type_symbol(cast_expr.typ).name
cast_expr.pos = pos.extend(cast_expr.pos)
}

View File

@@ -578,7 +578,7 @@ fn (mut p Parser) fn_receiver(mut params []ast.Param, mut rec ReceiverParsingInf
if type_sym.kind == .struct_ {
info := type_sym.info as ast.Struct
if !rec.is_mut && !rec.typ.is_ptr() && info.fields.len > 8 {
rec.typ = rec.typ.to_ptr()
rec.typ = rec.typ.ref()
is_auto_rec = true
}
}
@@ -801,7 +801,7 @@ fn (mut p Parser) fn_args() ([]ast.Param, bool, bool) {
// if arg_type.is_ptr() {
// p.error('cannot mut')
// }
// arg_type = arg_type.to_ptr()
// arg_type = arg_type.ref()
arg_type = arg_type.set_nr_muls(1)
if is_shared {
arg_type = arg_type.set_flag(.shared_f)