[vim9] E1027 when using try catch

7 views
Skip to first unread message

Dominique Pellé

unread,
Jan 11, 2022, 5:25:03 PM1/11/22
to vim_dev
Hi

Calling the following vim9 Foo() function gives an error:
E1027: Missing return statement

```
vim9script

def Foo(): string
try
return "foo"
catch
return "bar"
endtry
enddef

Foo()
```

IMO, this function should be fine, it should not cause a E1027 error.
I can work around by adding a return at the end after the entry,
but it's deadcode. All code paths already return.

Regards
Dominique
Reply all
Reply to author
Forward
0 new messages