Skip to content

Commit faa180d

Browse files
committed
updated error for invalid step argument
1 parent 1e6fbb9 commit faa180d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/typecheck.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ fn check_stmt_types(
7474
handler.emit_diagnostic_expr(
7575
tr,
7676
exprid,
77-
&format!("Incorrect value to step"),
77+
&format!("Step argument must be a positive, non-zero integeral literal."),
7878
Level::Error,
7979
);
8080
}

tests/snapshots/protocols__typecheck__tests__invalid_step_arg.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ error: Cannot assign to function argument. Try using assert_eq if you want to ch
88
6 │ a := b;
99
^^^^^^^ Cannot assign to function argument. Try using assert_eq if you want to check the value of a transaction output.
1010

11-
error: Incorrect value to step
11+
error: Step argument must be a positive, non-zero integeral literal.
1212
┌─ tests/invalid_step_arg.prot:8:8
1313
1414
8 │ step(0);
15-
^ Incorrect value to step
15+
^ Step argument must be a positive, non-zero integeral literal.
1616

1717
error: Cannot assign to function argument. Try using assert_eq if you want to check the value of a transaction output.
1818
┌─ tests/invalid_step_arg.prot:9:3

0 commit comments

Comments
 (0)