Full source: https://github.com/straw-hat-team/straw_hat_twitch/tree/master/lib/straw_hat_twitch/chat
I have the following module
defmodule StrawHat.Twitch.Chat.Message do
@type t :: %__MODULE__{
username: String.t(),
channel_name: String.t(),
body: String.t()
}
end
And this other one
defmodule StrawHat.Twitch.Chat.MessageBroker do
@callback publish(pid, %StrawHat.Twitch.Chat.Message{}) :: no_return
end
When I use %StrawHat.Twitch.Chat.Message{} in StrawHat.Twitch.Chat.MessageBroker it generates the documentation using just %

When I change it to StrawHat.Twitch.Chat.Message.t it renames the argument to arg1
I am confused why it is behaving differently when for the most part should be the same.
As per https://hexdocs.pm/elixir/Kernel.html#defstruct/1-types, it's recommended to use SomeStruct.t over %SomeStruct{} when _referencing_ a struct type, but yeah, it's definitely a bug - thanks for the report.
it's recommended to use
SomeStruct.tover%SomeStruct{}
@wojtekmach aye! I am using t since was an accident 馃槃
Most helpful comment
As per https://hexdocs.pm/elixir/Kernel.html#defstruct/1-types, it's recommended to use
SomeStruct.tover%SomeStruct{}when _referencing_ a struct type, but yeah, it's definitely a bug - thanks for the report.