Skip to content

Commit cbf30bd

Browse files
committed
checker: fix regression for generics_test.v
1 parent d8d6e9b commit cbf30bd

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

vlib/v/checker/checker.v

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2276,12 +2276,20 @@ pub fn (mut c Checker) fn_call(mut call_expr ast.CallExpr) ast.Type {
22762276
if !found {
22772277
if v := call_expr.scope.find_var(fn_name) {
22782278
if v.typ != 0 {
2279-
vts := c.table.get_type_symbol(c.unwrap_generic(v.typ))
2280-
if vts.kind == .function {
2281-
info := vts.info as ast.FnType
2279+
generic_vts := c.table.get_type_symbol(v.typ)
2280+
if generic_vts.kind == .function {
2281+
info := generic_vts.info as ast.FnType
22822282
func = info.func
22832283
found = true
22842284
found_in_args = true
2285+
} else {
2286+
vts := c.table.get_type_symbol(c.unwrap_generic(v.typ))
2287+
if vts.kind == .function {
2288+
info := vts.info as ast.FnType
2289+
func = info.func
2290+
found = true
2291+
found_in_args = true
2292+
}
22852293
}
22862294
}
22872295
}

0 commit comments

Comments
 (0)