mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
parser/cgen: anon fn var & calling (#4534)
This commit is contained in:
@@ -390,14 +390,13 @@ pub fn (var t Table) find_or_register_multi_return(mr_typs []Type) int {
|
||||
return t.register_type_symbol(mr_type)
|
||||
}
|
||||
|
||||
pub fn (var t Table) find_or_register_fn_type(f Fn, has_decl bool) int {
|
||||
is_anon := f.name.len == 0
|
||||
name := if is_anon { 'anon_fn_$f.signature()' } else { f.name }
|
||||
pub fn (var t Table) find_or_register_fn_type(f Fn, is_anon bool, has_decl bool) int {
|
||||
name := if f.name.len == 0 { 'anon_fn_$f.signature()' } else { f.name }
|
||||
return t.register_type_symbol(TypeSymbol{
|
||||
kind: .function
|
||||
name: name
|
||||
info: FnType{
|
||||
is_anon: is_anon
|
||||
is_anon: f.name.len == 0 || is_anon
|
||||
has_decl: has_decl
|
||||
func: f
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user