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

compiler: more memory logic + replace "cur_fn &Fn" with "cur_fn Fn"

This commit is contained in:
Alexander Medvednikov
2019-09-09 16:22:39 +03:00
parent f3a74e7d80
commit 9dd86f6fb8
8 changed files with 114 additions and 78 deletions

View File

@ -77,6 +77,7 @@ mut:
is_used bool
is_changed bool
scope_level int
is_c bool // todo remove once `typ` is `Type`, not string
}
struct Type {
@ -442,6 +443,7 @@ fn (table mut Table) add_method(type_name string, f Fn) {
print_backtrace()
cerror('add_method: empty type')
}
// TODO table.typesmap[type_name].methods << f
mut t := table.typesmap[type_name]
t.methods << f
table.typesmap[type_name] = t