incorrectly indented record fields after :: fun() spec
michalwski opened this issue · 1 comments
michalwski commented
-record(state,
{step = 2 :: 2 | 4,
stored_key = <<"">> :: binary(),
server_key = <<"">> :: binary(),
username = <<"">> :: binary(),
get_password :: fun(),
check_password :: fun(),
auth_message = <<"">> :: binary(),
client_nonce = <<"">> :: binary(),
server_nonce = <<"">> :: binary()}).
should be:
-record(state,
{step = 2 :: 2 | 4,
stored_key = <<"">> :: binary(),
server_key = <<"">> :: binary(),
username = <<"">> :: binary(),
get_password :: fun(),
check_password :: fun(),
auth_message = <<"">> :: binary(),
client_nonce = <<"">> :: binary(),
server_nonce = <<"">> :: binary()}).hcs42 commented
Currently type specifications are not handled at all – i.e. they will be indented as if they were plain Erlang code. So in the code above, the indentation script will think that fun() is the beginning of a fun.
There is a ticket about making type specs work in general (#2), so I'm closing this ticket.