diff --git a/doc/docs.md b/doc/docs.md index 3263a5d42c..8b34a21a19 100644 --- a/doc/docs.md +++ b/doc/docs.md @@ -1635,7 +1635,7 @@ propagate the error: import net.http fn f(url string) ?string { - resp := http.get(url)? + resp := http.get(url) ? return resp.text } ``` diff --git a/vlib/v/fmt/fmt.v b/vlib/v/fmt/fmt.v index 4e03611348..84399b4761 100644 --- a/vlib/v/fmt/fmt.v +++ b/vlib/v/fmt/fmt.v @@ -1136,7 +1136,7 @@ pub fn (mut f Fmt) or_expr(or_block ast.OrExpr) { } } .propagate { - f.write('?') + f.write(' ?') } } } diff --git a/vlib/v/fmt/tests/optional_propagate_keep.vv b/vlib/v/fmt/tests/optional_propagate_keep.vv index bf287bd4d9..0cd4524f9e 100644 --- a/vlib/v/fmt/tests/optional_propagate_keep.vv +++ b/vlib/v/fmt/tests/optional_propagate_keep.vv @@ -1,3 +1,3 @@ fn opt_propagate() ?int { - eventual_wrong_int()? + eventual_wrong_int() ? } diff --git a/vlib/v/fmt/tests/orm_keep.vv b/vlib/v/fmt/tests/orm_keep.vv index 7b2643bd2b..33c5a7917a 100644 --- a/vlib/v/fmt/tests/orm_keep.vv +++ b/vlib/v/fmt/tests/orm_keep.vv @@ -14,7 +14,7 @@ fn find_all_customers(db sqlite.DB) []Customer { } fn main() { - db := sqlite.connect('customers.db')? + db := sqlite.connect('customers.db') ? // select count(*) from Customer nr_customers := sql db { select count from Customer