diff --git a/vlib/v/checker/tests/option_multi_return_err.out b/vlib/v/checker/tests/option_multi_return_err.out new file mode 100644 index 00000000000000..28fd7e77323c69 --- /dev/null +++ b/vlib/v/checker/tests/option_multi_return_err.out @@ -0,0 +1,7 @@ +vlib/v/checker/tests/option_multi_return_err.vv:6:14: error: split() returns `?(string, string)`, so it should have either an `or {}` block, or `?` at the end + 4 | + 5 | fn main() { + 6 | foo, bar := split('foo/bar') + | ~~~~~~~~~~~~~~~~ + 7 | println('${foo}.${bar}') + 8 | } diff --git a/vlib/v/checker/tests/option_multi_return_err.vv b/vlib/v/checker/tests/option_multi_return_err.vv new file mode 100644 index 00000000000000..d22c8aae612b87 --- /dev/null +++ b/vlib/v/checker/tests/option_multi_return_err.vv @@ -0,0 +1,8 @@ +fn split(str string) ?(string, string) { + return none +} + +fn main() { + foo, bar := split('foo/bar') + println('${foo}.${bar}') +}