Skip to content

Commit 393d5b9

Browse files
authored
checker: set ast file fallbacks for vls (fix #25678) (#25679)
1 parent 0a65a4f commit 393d5b9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

vlib/v/checker/checker.v

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,11 @@ pub fn (mut c Checker) check_files(ast_files []&ast.File) {
391391
}
392392
}
393393
c.timers.start('checker_post_process_generic_fns')
394-
last_file := c.file
394+
mut last_file := c.file
395+
// c.file might be nil in vls mode, fall back to first file
396+
if c.pref.is_vls && last_file == unsafe { nil } && ast_files.len > 0 {
397+
last_file = ast_files[0]
398+
}
395399
// post process generic functions. must be done after all files have been
396400
// checked, to ensure all generic calls are processed, as this information
397401
// is needed when the generic type is auto inferred from the call argument.

0 commit comments

Comments
 (0)