do not generate interface tables for unused interfaces

pull/2712/head
Alexander Medvednikov 2019-11-09 18:13:51 +03:00
parent be4eaa680a
commit f33d8bd596
2 changed files with 6 additions and 3 deletions

View File

@ -397,6 +397,7 @@ fn (v &V) interface_table() string {
continue
}
mut methods := ''
sb.writeln('// NR methods = $t.gen_types.len')
for i, gen_type in t.gen_types {
methods += '{'
for i, method in t.methods {
@ -410,11 +411,12 @@ fn (v &V) interface_table() string {
// Speaker_Cat_index = 0
sb.writeln('int _${t.name}_${gen_type}_index = $i;')
}
if t.methods.len == 0 {
methods = '{TCCSKIP(0)}'
}
if t.gen_types.len > 0 {
// methods = '{TCCSKIP(0)}'
// }
sb.writeln('void* (* ${t.name}_name_table[][$t.methods.len]) = ' +
'{ $methods }; ')
}
continue
}
return sb.str()

View File

@ -653,6 +653,7 @@ pub fn (v &V) get_user_files() []string {
mut user_files := []string
if v.pref.is_test {
// TODO this somtimes fails on CI
user_files << filepath.join(v.vroot,'vlib','compiler','preludes','tests_assertions.v')
}