Base: Reject invalid arities in bottom-type fallbacks #63338
All Vouch review confidence checks passed
Residual risk 0.14 = Change Risk (0.36) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 194 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.315
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #63338"
general
weight: 0.35
adienes
Several
Type{Union{}}fallbacks in Base use thef(::Type{Union{}}, slurp...)form, which lets method lookup skip candidates that overlap only throughUnion{}(JuliaLang/julia#49470). Most of themthrow, but some return a value, e.g.from JuliaLang/julia#53616 and
Because they return regardless of
slurp, invalid calls such ascomplex(Union{}, 1)succeed, and inference of e.g.complex(::Any, ::Any)picks up a spuriousType{Union{}}result. Since this is a returned type object rather than an unreachable result, it propagates into callers: static analyzers such as JET then analyze e.g.complex(a, b) / 2asUnion{} / 2and report a falseMethodError.Move the successful results into fixed-arity methods and make the variadic methods throw
MethodErrorfor extra arguments. This keeps valid calls such ascomplex(Union{})working, while invalid arities no longer contribute to inferred return types. Results for extra arguments were never documented and only existed as a side effect of the pruning-only signatures, so making them throw is not a breaking change.The variadic signatures are kept only for lookup pruning. A regression from JuliaLang/julia#61915 currently disables that pruning, so they have no effect on master for now, but they become effective again once JuliaLang/julia#63336 restores it.
Assisted-by: ChatGPT (GPT-6-Astra)
Assisted-by: Claude Code (Opus 5.5)