We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
The text was updated successfully, but these errors were encountered:
Consider this plugin
typed_struct_ctor
new
from
Try the macro out in real time without having to install or write any of your own code. All you need is a running instance of Livebook
Sorry, something went wrong.
Hello @meox, this is indeed a bug: we should check that the second argument to field/2 is a type.
field/2
No branches or pull requests
I have a typedstruct defined in this way:
If I default construct the record in this way: %Msg{} I got
instead of
Specifying the typespec everything works as expected.
The text was updated successfully, but these errors were encountered: