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

Hack interfaces into working with arguments

This commit is contained in:
F1ssi0N 2019-07-27 13:06:36 +01:00 committed by Alexander Medvednikov
parent 26a1762156
commit 720648703b

View File

@ -888,7 +888,13 @@ fn (f &Fn) str_args(table *Table) string {
// Now all methods // Now all methods
interface_type := table.find_type(arg.typ) interface_type := table.find_type(arg.typ)
for method in interface_type.methods { for method in interface_type.methods {
s += ', $method.typ (*${arg.typ}_${method.name})(void*) ' s += ', $method.typ (*${arg.typ}_${method.name})(void*'
if method.args.len > 1 {
for a in method.args.right(1) {
s += ', $a.typ'
}
}
s += ')'
} }
} }
else if arg.name == '..' { else if arg.name == '..' {