Skip to content

Deprecate non-list fields in struct/2 and struct!/2 - #16146

Open
josevalim wants to merge 1 commit into
mainfrom
deprecate-non-list-struct-fields
Open

josevalim wants to merge 1 commit into
mainfrom
deprecate-non-list-struct-fields

Conversation

@josevalim

Copy link
Copy Markdown
Member

Passing any enumerable other than a list now emits a warning once per caller.

As a consequence, the generated struct/1 now uses :lists.foldl/3 and expects a list of fields.

This will allow us to provide more precise type signatures for all of these contructs.

Passing any enumerable other than a list now emits a warning once
per caller. As a consequence, the generated __struct__/1 now uses
:lists.foldl/3 and expects a list of fields.
@josevalim josevalim added this to the v1.22 milestone Nov 18, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant