facebook / facebook/pyrefly

Report a warning if the argument expansion limit is hit

Open
#4,213 8 comments 0 reactions 1 assignee Claimed by @markselby9 View on GitHub
help wanted quansight stale typechecking
Dominant language
Rust
Stars
7k
Forks
519
PR merge metrics
No merged PRs in 30d

Description

This limit is set to 100:

https://github.com/facebook/pyrefly/blob/7ffcd9ba2210a6f621d565fcf6504cfc707a64da/pyrefly/lib/alt/overload.rs#L91

If this limit is exceeded, then the expansion loop simply terminates silently, so it'l behave as if there's nothing left to expand.

In overload-heavy libraries like NumPy and scipy-stubs, there might be functions or methods where there are more than 100 argument expansions needed, but there's no way of knowing.

So I propose that Pyrefly emits a warning if this argument expansion limit is exceeded. Then, if there turn out to many such warnings in practice, we can consider increasing the limit.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.