diff --git a/vlib/v/checker/comptime.v b/vlib/v/checker/comptime.v index a581582629..dbb61cd3fa 100644 --- a/vlib/v/checker/comptime.v +++ b/vlib/v/checker/comptime.v @@ -9,7 +9,6 @@ import v.util import v.pkgconfig fn (mut c Checker) comptime_call(mut node ast.ComptimeCall) ast.Type { - sym := c.table.get_type_symbol(c.unwrap_generic(c.expr(node.left))) node.left_type = c.expr(node.left) if node.is_env { env_value := util.resolve_env_value("\$env('$node.args_var')", false) or { @@ -94,11 +93,11 @@ fn (mut c Checker) comptime_call(mut node ast.ComptimeCall) ast.Type { } else { c.error('todo: not a string literal', node.method_pos) } - f := sym.find_method(method_name) or { + left_sym := c.table.get_type_symbol(c.unwrap_generic(node.left_type)) + f := left_sym.find_method(method_name) or { c.error('could not find method `$method_name`', node.method_pos) return ast.void_type } - // println(f.name + ' ' + c.table.type_to_str(f.return_type)) node.result_type = f.return_type return f.return_type }