I have a typedstruct defined in this way:
defmodule Msg do
use TypedStruct
typedstruct do
field(:version, default: 1)
field(:note, String.t(), default: "")
end
end
If I default construct the record in this way: %Msg{} I got
%Msg{version: nil, note: ""}
instead of
%Msg{version: 1, note: ""}
Specifying the typespec everything works as expected.