mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
cgen: remove "main" from inline sum type str (#12963)
This commit is contained in:
parent
35282396ec
commit
10f63b3cd7
@ -436,7 +436,7 @@ fn (mut g Gen) gen_str_for_union_sum_type(info ast.SumType, styp string, str_fn_
|
|||||||
fn_builder.writeln('static string indent_${str_fn_name}($styp x, int indent_count) {')
|
fn_builder.writeln('static string indent_${str_fn_name}($styp x, int indent_count) {')
|
||||||
mut clean_sum_type_v_type_name := ''
|
mut clean_sum_type_v_type_name := ''
|
||||||
if info.is_anon {
|
if info.is_anon {
|
||||||
variant_names := info.variants.map(g.table.sym(it).name)
|
variant_names := info.variants.map(util.strip_main_name(g.table.sym(it).name))
|
||||||
clean_sum_type_v_type_name = '(${variant_names.join(' | ')})'
|
clean_sum_type_v_type_name = '(${variant_names.join(' | ')})'
|
||||||
} else {
|
} else {
|
||||||
clean_sum_type_v_type_name = styp.replace('__', '.')
|
clean_sum_type_v_type_name = styp.replace('__', '.')
|
||||||
|
Loading…
Reference in New Issue
Block a user