Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
felipensp committed Dec 29, 2024
1 parent b56d653 commit c72231c
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 32 deletions.
21 changes: 0 additions & 21 deletions vlib/v/checker/assign.v
Original file line number Diff line number Diff line change
Expand Up @@ -411,27 +411,6 @@ fn (mut c Checker) assign_stmt(mut node ast.AssignStmt) {
&& c.type_resolver.is_generic_expr(right) {
// mark variable as generic var because its type changes according to fn return generic resolution type
left.obj.ct_type_var = .generic_var
if right.return_type_generic.has_flag(.generic) {
// fn_ret_type := c.resolve_return_type(right)
// if fn_ret_type != ast.void_type
// && c.table.final_sym(fn_ret_type).kind != .multi_return {
// var_type := if right.or_block.kind == .absent {
// fn_ret_type
// } else {
// fn_ret_type.clear_option_and_result()
// }
// // c.type_resolver.update_generic(left, var_type)
// }
} else if right.is_static_method
&& right.left_type.has_flag(.generic) {
// fn_ret_type := c.unwrap_generic(c.resolve_return_type(right))
// var_type := if right.or_block.kind == .absent {
// fn_ret_type
// } else {
// fn_ret_type.clear_option_and_result()
// }
// c.type_resolver.update_generic(left, var_type)
}
}
}
}
Expand Down
2 changes: 0 additions & 2 deletions vlib/v/gen/c/assign.v
Original file line number Diff line number Diff line change
Expand Up @@ -355,14 +355,12 @@ fn (mut g Gen) assign_stmt(node_ ast.AssignStmt) {
var_type = fn_ret_type
val_type = var_type
left.obj.typ = var_type
// g.type_resolver.update_generic(left, var_type)
}
} else if val.is_static_method && val.left_type.has_flag(.generic) {
fn_ret_type := g.resolve_return_type(val)
var_type = fn_ret_type
val_type = var_type
left.obj.typ = var_type
// g.type_resolver.update_generic(left, var_type)
g.assign_ct_type = var_type
}
}
Expand Down
9 changes: 0 additions & 9 deletions vlib/v/type_resolver/type_resolver.v
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,6 @@ pub fn TypeResolver.new(table &ast.Table, resolver &IResolverType) &TypeResolver
}
}

// update_generic updates generic type for specific variables (for overwriting its last known checker type)
// `var` are usually variables as `var := fn_returning_generic()`
@[inline]
pub fn (mut t TypeResolver) update_generic(var ast.Ident, var_type ast.Type) {
if var.obj is ast.Var {
// t.type_map['g.${var.name}.${var.obj.pos.pos}'] = var_type
}
}

// update_ct_type updates current type for specific key (comptime vars)
// `var` iteration vars, comptime vars
// `var.typ` => for comptime $for variables
Expand Down

0 comments on commit c72231c

Please sign in to comment.