From cbf30bd13a7d428529bbe494754aa8958b557a54 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Sat, 8 May 2021 18:23:12 +0300 Subject: [PATCH] checker: fix regression for generics_test.v --- vlib/v/checker/checker.v | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/vlib/v/checker/checker.v b/vlib/v/checker/checker.v index 2c8e1dea5b..949c155049 100644 --- a/vlib/v/checker/checker.v +++ b/vlib/v/checker/checker.v @@ -2276,12 +2276,20 @@ pub fn (mut c Checker) fn_call(mut call_expr ast.CallExpr) ast.Type { if !found { if v := call_expr.scope.find_var(fn_name) { if v.typ != 0 { - vts := c.table.get_type_symbol(c.unwrap_generic(v.typ)) - if vts.kind == .function { - info := vts.info as ast.FnType + generic_vts := c.table.get_type_symbol(v.typ) + if generic_vts.kind == .function { + info := generic_vts.info as ast.FnType func = info.func found = true found_in_args = true + } else { + vts := c.table.get_type_symbol(c.unwrap_generic(v.typ)) + if vts.kind == .function { + info := vts.info as ast.FnType + func = info.func + found = true + found_in_args = true + } } } }