[vim/vim] vim9: try to find a variable while want a function for an 'autoloaded' file (Issue #20911)

Mao-Yining (Vim Github Repository) <[email protected]> Sat, 01 Aug 2026 06:28:06 -0700
Newsgroups gmane.editors.vim.devel
Message-ID <vim/vim/issues/[email protected]>
mao-yining created an issue (vim/vim#20911)

### Steps to reproduce

`b.vim`:

```vim
vim9script
export def F()
enddef
```
`a.vim`:

```vim
vim9script
import autoload "./b.vim"
def F()
	var A: func = b.F
enddef
F()
```

DON'T PUT THESE FILES UNDER `autoload/`!

source `a.vim`, then throw `E121`.

### Expected behaviour

No error

### Version of Vim

9.2.0888

### Environment

MS-Windows

### Logs and stack traces

```shell

```

-- 
Reply to this email directly or view it on GitHub:
https://github.com/vim/vim/issues/20911
You are receiving this because you are subscribed to this thread.

Message ID: <vim/vim/issues/[email protected]>

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/vim_dev/vim/vim/issues/20911%40github.com.