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

cgen: minor cleanup in auto_str_methods.v (#16411)

This commit is contained in:
yuyi 2022-11-13 16:59:32 +08:00 committed by GitHub
parent f31a3b4250
commit 5a28699edb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -80,12 +80,11 @@ fn (mut g Gen) get_str_fn(typ ast.Type) string {
}
}
if sym.has_method_with_generic_parent('str') {
if mut sym.info is ast.Struct {
str_fn_name = g.generic_fn_name(sym.info.concrete_types, str_fn_name)
} else if mut sym.info is ast.SumType {
str_fn_name = g.generic_fn_name(sym.info.concrete_types, str_fn_name)
} else if mut sym.info is ast.Interface {
str_fn_name = g.generic_fn_name(sym.info.concrete_types, str_fn_name)
match mut sym.info {
ast.Struct, ast.SumType, ast.Interface {
str_fn_name = g.generic_fn_name(sym.info.concrete_types, str_fn_name)
}
else {}
}
}
g.str_types << StrType{