Skip to content

Treeshake-related fixes - #767

Open
mat-hek wants to merge 3 commits into
mainfrom
mf/treeshake-fixes
Open

Treeshake-related fixes#767
mat-hek wants to merge 3 commits into
mainfrom
mf/treeshake-fixes

Conversation

@mat-hek

@mat-hek mat-hek commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@mat-hek
mat-hek requested a review from jgonet August 21, 2026 14:23
@mat-hek mat-hek changed the title Mf/treeshake fixes Treeshake-related fixes Aug 21, 2026
Comment on lines +62 to +63
context = Keyword.get(meta, :context),
is_atom(context) and context != module do

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I discovered you can use guards in with btw:

context when is_atom(context) <- Keyword.get(meta, :context)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is for, not with

info
|> Map.get(:macro_generated, [])
|> Enum.filter(&Map.has_key?(info.public_functions, &1))
|> Enum.reject(fn {f, _a} -> f == :__struct__ end)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is_struct/1?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is_struct works on real structs like %Foo{}, this is just an atom :__struct__

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants