Foo.vim:
vim9script
export class Foo
def new()
enddef
def Bar(s: string)
echo $"{s} works"
enddef
endclass
vim9_regression.vim:
vim9script
if get(g:, 'did_foo', false)
finish
endif
g:did_foo = true
import autoload './Foo.vim'
var foo =
Foo.Foo.new()
command -buffer -bar -nargs=1 Foo foo.Bar(<f-args>)
Source vim9_regression.vim, and run ":Foo bar" and you'll get the expected "bar works" message, but source vim9_regression.vim again you'll get:
E121: Undefined variable: foo
--