Skip to content

Defer function application computations until needed - #15676

Merged
josevalim merged 3 commits into
elixir-lang:mainfrom
preciz:opt/fun-apply-empty-args
Jul 25, 2026
Merged

Defer function application computations until needed#15676
josevalim merged 3 commits into
elixir-lang:mainfrom
preciz:opt/fun-apply-empty-args

Conversation

@preciz

@preciz preciz commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Assisted-by: Codex CLI:GPT-5.6 Sol

Defer creating the 2 variables.

Comment thread lib/elixir/lib/module/types/descr.ex Outdated
{:badarg, arguments, true}
else
args_domain = args_to_domain(arguments)
static? = fun_dynamic == nil and Enum.all?(arguments, fn arg -> not gradual?(arg) 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.

It feels both of these should be move inside the with and the arity = should be here.

@preciz preciz Jul 25, 2026

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.

I should have spotted that, thank you!

@josevalim
josevalim merged commit b8c1eb7 into elixir-lang:main Jul 25, 2026
15 checks passed
@josevalim

Copy link
Copy Markdown
Member

💚 💙 💜 💛 ❤️

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.

2 participants