cgen: improve auto_str error messages (#12972)

pull/12883/head
yuyi 2021-12-27 00:32:15 +08:00 committed by GitHub
parent 55d9c24063
commit 2e68af22d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -105,7 +105,7 @@ fn (mut g Gen) gen_str_default(sym ast.TypeSymbol, styp string, str_fn_name stri
convertor = 'bool' convertor = 'bool'
typename_ = 'bool' typename_ = 'bool'
} else { } else {
verror("could not generate string method for type '$styp'") verror('could not generate string method for type `$styp`')
} }
g.type_definitions.writeln('string ${str_fn_name}($styp it); // auto') g.type_definitions.writeln('string ${str_fn_name}($styp it); // auto')
g.auto_str_funcs.writeln('string ${str_fn_name}($styp it) {') g.auto_str_funcs.writeln('string ${str_fn_name}($styp it) {')
@ -220,7 +220,7 @@ fn (mut g Gen) final_gen_str(typ StrType) {
g.gen_str_for_thread(sym.info, styp, str_fn_name) g.gen_str_for_thread(sym.info, styp, str_fn_name)
} }
else { else {
verror("could not generate string method $str_fn_name for type '$styp'") verror('could not generate string method `$str_fn_name` for type `$styp`')
} }
} }
} }