v.gen.c: fix v_typeof_interface_idx codegen (add `static `)

pull/11187/head
Delyan Angelov 2021-08-15 09:15:17 +03:00
parent 1bfb525ce1
commit f67e5d12e5
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
1 changed files with 1 additions and 1 deletions

View File

@ -587,7 +587,7 @@ pub fn (mut g Gen) write_typeof_functions() {
g.writeln('\treturn "unknown ${util.strip_main_name(typ.name)}";') g.writeln('\treturn "unknown ${util.strip_main_name(typ.name)}";')
g.writeln('}') g.writeln('}')
g.writeln('') g.writeln('')
g.writeln('int v_typeof_interface_idx_${typ.cname}(int sidx) { /* $typ.name */ ') g.writeln('static int v_typeof_interface_idx_${typ.cname}(int sidx) { /* $typ.name */ ')
for t in inter_info.types { for t in inter_info.types {
subtype := g.table.get_type_symbol(t) subtype := g.table.get_type_symbol(t)
g.writeln('\tif (sidx == _${typ.cname}_${subtype.cname}_index) return ${int(t)};') g.writeln('\tif (sidx == _${typ.cname}_${subtype.cname}_index) return ${int(t)};')