ast:remove cached_name, as auto_str_methods free it

This commit is contained in:
kbkpbot 2025-08-11 16:00:40 +08:00
parent 350747793b
commit 57e827a832
2 changed files with 1 additions and 8 deletions

View file

@ -1094,7 +1094,6 @@ pub mut:
mod string
name string
full_name string
cached_name string
kind IdentKind
info IdentInfo
is_mut bool // if mut *token* is before name. Use `is_mut()` to lookup mut variable

View file

@ -525,13 +525,7 @@ pub fn (x &Expr) str() string {
return 'spawn ${x.call_expr}'
}
Ident {
if x.cached_name != '' {
return x.cached_name
}
unsafe {
x.cached_name = util.strip_main_name(x.name.clone())
}
return x.cached_name
return x.name.clone()
}
IfExpr {
mut parts := []string{}