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

checker: fix generic os.fn call (script) without mod prefix. fixes #7073

This commit is contained in:
joe-conigliaro 2020-12-02 21:40:44 +11:00
parent ca7692c839
commit cd46eb42d7
No known key found for this signature in database
GPG Key ID: C12F7136C08206F1

View File

@ -1433,6 +1433,9 @@ pub fn (mut c Checker) call_fn(mut call_expr ast.CallExpr) table.Type {
if c.pref.is_script && !found {
os_name := 'os.$fn_name'
if f1 := c.table.find_fn(os_name) {
if f1.is_generic && call_expr.generic_type != table.void_type {
c.table.fn_gen_types[os_name] = c.table.fn_gen_types['${call_expr.mod}.$call_expr.name']
}
call_expr.name = os_name
found = true
f = f1