Skip to content

Commit

Permalink
ast, parser: fixed residual old syntax '<', '>' in generic type names
Browse files Browse the repository at this point in the history
  • Loading branch information
shove70 committed Dec 1, 2023
1 parent e30af86 commit 4cb5a8e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions vlib/v/ast/table.v
Original file line number Diff line number Diff line change
Expand Up @@ -1955,7 +1955,7 @@ pub fn (mut t Table) unwrap_generic_type(typ Type, generic_names []string, concr
if mut parent_info is Struct {
for mut embed in parent_info.embeds {
if embed == orig_type {
embed = fields[i].typ.set_flag(.generic)
embed = fields[i].typ
break
}
}
Expand Down Expand Up @@ -2138,7 +2138,7 @@ pub fn (mut t Table) generic_insts_to_concrete() {
if fields[i].name.len > 1 && fields[i].name[0].is_capital() {
for mut embed in parent_info.embeds {
if embed == orig_type {
embed = fields[i].typ.set_flag(.generic)
embed = fields[i].typ
break
}
}
Expand Down
4 changes: 2 additions & 2 deletions vlib/v/parser/parse_type.v
Original file line number Diff line number Diff line change
Expand Up @@ -718,14 +718,14 @@ fn (mut p Parser) find_type_or_add_placeholder(name string, language ast.Languag
&& p.struct_init_generic_types != sym.info.generic_types {
generic_names := p.types_to_names(p.struct_init_generic_types, p.tok.pos(),
'struct_init_generic_types') or { return ast.Type(0) }
mut sym_name := sym.name + '<'
mut sym_name := sym.name + '['
for i, gt in generic_names {
sym_name += gt
if i != generic_names.len - 1 {
sym_name += ','
}
}
sym_name += '>'
sym_name += ']'
existing_idx := p.table.type_idxs[sym_name]
if existing_idx > 0 {
idx = existing_idx
Expand Down

0 comments on commit 4cb5a8e

Please sign in to comment.