Skip to content

Commit

Permalink
ra_machine: Make the version/0 callback return a version() type
Browse files Browse the repository at this point in the history
[Why]
0 is a valid machine version. It is the default one when the callback is
undefined. However, the callback spec states that a `pos_integer()`
should be returned which forbids a version of 0.

[How]
Simply change the callback return value to `version()`. This makes 0 a
valid return value and reuses the existing type already used elsewhere.
  • Loading branch information
dumbbell committed Oct 19, 2023
1 parent abfef5a commit dcc9da4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ra_machine.erl
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@

-callback snapshot_module() -> module().

-callback version() -> pos_integer().
-callback version() -> version().

-callback which_module(version()) -> module().

Expand Down

0 comments on commit dcc9da4

Please sign in to comment.