cgen: fix interface parameters in fn type aliases (#11247)

pull/11251/head
spaceface 2021-08-20 00:12:31 +02:00 committed by GitHub
parent a9fb24cb5f
commit 67e8031a08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -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) { pub fn (mut g Gen) write_interface_typedef(sym ast.TypeSymbol) {
struct_name := c_name(sym.cname) 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) { pub fn (mut g Gen) write_interface_typesymbol_declaration(sym ast.TypeSymbol) {

View File

@ -47,6 +47,10 @@ type F7 = fn (time.Time, int)
type MyTime = time.Time type MyTime = time.Time
type F8 = fn (MyTime) type F8 = fn (MyTime)
interface MyInterface {}
type F9 = fn (MyInterface)
fn C.atoi(&byte) int fn C.atoi(&byte) int
fn C.freec(ptr voidptr) fn C.freec(ptr voidptr)