diff --git a/vlib/v/gen/c/cgen.v b/vlib/v/gen/c/cgen.v index 495d82786e..4c8967af39 100644 --- a/vlib/v/gen/c/cgen.v +++ b/vlib/v/gen/c/cgen.v @@ -945,7 +945,7 @@ pub fn (mut g Gen) write_alias_typesymbol_declaration(sym ast.TypeSymbol) { pub fn (mut g Gen) write_interface_typedef(sym ast.TypeSymbol) { struct_name := c_name(sym.cname) - g.type_definitions.writeln('typedef struct $struct_name $struct_name;') + g.typedefs.writeln('typedef struct $struct_name $struct_name;') } pub fn (mut g Gen) write_interface_typesymbol_declaration(sym ast.TypeSymbol) { diff --git a/vlib/v/tests/fn_test.v b/vlib/v/tests/fn_test.v index b85fb9aa4d..6555127c4d 100644 --- a/vlib/v/tests/fn_test.v +++ b/vlib/v/tests/fn_test.v @@ -47,6 +47,10 @@ type F7 = fn (time.Time, int) type MyTime = time.Time type F8 = fn (MyTime) +interface MyInterface {} + +type F9 = fn (MyInterface) + fn C.atoi(&byte) int fn C.freec(ptr voidptr)