From a678be71951d6fb24afa0a15bb7d9a6db58033cb Mon Sep 17 00:00:00 2001 From: yuyi Date: Sat, 29 Feb 2020 22:27:28 +0800 Subject: [PATCH] fix interface on all platforms --- vlib/compiler/fn.v | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/vlib/compiler/fn.v b/vlib/compiler/fn.v index efc4ff1dc9..215131b022 100644 --- a/vlib/compiler/fn.v +++ b/vlib/compiler/fn.v @@ -1117,17 +1117,10 @@ fn (p mut Parser) fn_call_args(f mut Fn, generic_param_types []string) { if t.cat == .interface_ { // perform((Speaker) { ._object = &dog, // _interface_idx = _Speaker_Dog_index }) - $if windows { - if !f.is_method { - concrete_type_name := typ.replace('*', '_ptr') - p.cgen.set_placeholder(ph, '($arg.typ) { ._object = &') - p.gen(', /*OLD*/ ._interface_idx = _${arg.typ}_${concrete_type_name}_index} /* i. arg*/') - } - } - $else { + if !f.is_method { concrete_type_name := typ.replace('*', '_ptr') p.cgen.set_placeholder(ph, '($arg.typ) { ._object = &') - p.gen(', /*OLD*/ ._interface_idx = _${arg.typ}_${concrete_type_name}_index} /* i. arg*/') + p.gen(', ._interface_idx = _${arg.typ}_${concrete_type_name}_index} ') } p.table.add_gen_type(arg.typ, typ) }