Update tip to parens syntax (#7771)

* Update to parens syntax

Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>

* update snapshots

---------

Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>
This commit is contained in:
Anton-4 2025-05-02 15:18:35 +02:00 committed by GitHub
parent 882577bebc
commit fac7041d11
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 49 additions and 48 deletions

View file

@ -4325,7 +4325,7 @@ mod test_reporting {
{ x, y }
"
),
@r#"
@r###"
IGNORED RESULT in /code/proj/Main.roc
The result of this expression is ignored:
@ -4340,7 +4340,7 @@ mod test_reporting {
If you still want to ignore it, assign it to `_`, like this:
_ = File.delete! "data.json"
_ = File.delete!("data.json")?
LEFTOVER STATEMENT in /code/proj/Main.roc
@ -4353,7 +4353,7 @@ mod test_reporting {
functions.
Did you forget to use its result? If not, feel free to remove it.
"#
"###
);
test_report!(
@ -14729,22 +14729,22 @@ All branches in an `if` must have the same type!
"#
),
@r###"
IGNORED RESULT in /code/proj/Main.roc
The result of this expression is ignored:
19 try List.get [1, 2, 3] 5
^^^^^^^^^^^^^^^^^^^^^^^^
Standalone statements are required to produce an empty record, but the
type of this one is:
Num *
If you still want to ignore it, assign it to `_`, like this:
_ = File.delete! "data.json"
"###
IGNORED RESULT in /code/proj/Main.roc
The result of this expression is ignored:
19 try List.get [1, 2, 3] 5
^^^^^^^^^^^^^^^^^^^^^^^^
Standalone statements are required to produce an empty record, but the
type of this one is:
Num *
If you still want to ignore it, assign it to `_`, like this:
_ = File.delete!("data.json")?
"###
);
test_report!(
@ -14774,7 +14774,7 @@ All branches in an `if` must have the same type!
Ok {}
"#
),
@r#"
@r###"
IGNORED RESULT in /code/proj/Main.roc
The result of this expression is ignored:
@ -14791,8 +14791,8 @@ All branches in an `if` must have the same type!
If you still want to ignore it, assign it to `_`, like this:
_ = File.delete! "data.json"
"#
_ = File.delete!("data.json")?
"###
);
test_report!(
@ -14852,22 +14852,22 @@ All branches in an `if` must have the same type!
"#
),
@r###"
IGNORED RESULT in /code/proj/Main.roc
The result of this expression is ignored:
9 try List.get [1, 2, 3] 5
^^^^^^^^^^^^^^^^^^^^^^^^
Standalone statements are required to produce an empty record, but the
type of this one is:
Num *
If you still want to ignore it, assign it to `_`, like this:
_ = File.delete! "data.json"
"###
IGNORED RESULT in /code/proj/Main.roc
The result of this expression is ignored:
9 try List.get [1, 2, 3] 5
^^^^^^^^^^^^^^^^^^^^^^^^
Standalone statements are required to produce an empty record, but the
type of this one is:
Num *
If you still want to ignore it, assign it to `_`, like this:
_ = File.delete!("data.json")?
"###
);
test_report!(
@ -14904,7 +14904,7 @@ All branches in an `if` must have the same type!
Ok {}
"#
),
@r#"
@r###"
IGNORED RESULT in /code/proj/Main.roc
The result of this expression is ignored:
@ -14921,8 +14921,8 @@ All branches in an `if` must have the same type!
If you still want to ignore it, assign it to `_`, like this:
_ = File.delete! "data.json"
"#
_ = File.delete!("data.json")?
"###
);
test_report!(
@ -14941,7 +14941,7 @@ All branches in an `if` must have the same type!
Ok {}
"#
),
@r#"
@r###"
IGNORED RESULT in /code/proj/Main.roc
The result of this call to `Num.to_str` is ignored:
@ -14956,7 +14956,7 @@ All branches in an `if` must have the same type!
If you still want to ignore it, assign it to `_`, like this:
_ = File.delete! "data.json"
_ = File.delete!("data.json")?
LEFTOVER STATEMENT in /code/proj/Main.roc
@ -14969,7 +14969,7 @@ All branches in an `if` must have the same type!
functions.
Did you forget to use its result? If not, feel free to remove it.
"#
"###
);
test_report!(
@ -15407,7 +15407,7 @@ All branches in an `if` must have the same type!
{}
"#
),
@r#"
@r###"
IGNORED RESULT in /code/proj/Main.roc
The result of this call to `Effect.get_line!` is ignored:
@ -15422,8 +15422,8 @@ All branches in an `if` must have the same type!
If you still want to ignore it, assign it to `_`, like this:
_ = File.delete! "data.json"
"#
_ = File.delete!("data.json")?
"###
);
test_report!(

View file

@ -1935,7 +1935,7 @@ fn to_expr_report<'b>(
alloc.reflow(", like this:"),
]),
alloc
.parser_suggestion("_ = File.delete! \"data.json\"")
.parser_suggestion("_ = File.delete!(\"data.json\")?")
.indent(4),
])
},

View file

@ -99,6 +99,7 @@
wasm-pack # for repl_wasm
jq # used in several bash scripts
cargo-nextest # used to give more info for segfaults for gen tests
cargo-insta # for snapshot tests like in roc_load::test_reporting
# cargo-udeps # to find unused dependencies
zls # zig language server