Repository navigation
fix: review findings that don't involve Any, and simplifications 🧹 - #345
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 95f02cf8cd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| && let [only] = nearest[..] | ||
| && self.takes_any_literal(only, arguments) | ||
| { | ||
| return EarlyOverload::Only(only); |
There was a problem hiding this comment.
Wait for nonliteral arguments before committing to a scope
When another argument is an unresolved nonliteral type variable, takes_any_literal does not establish that this overload will still accept the call once that argument is known. For example, fn d(x: Int, y: String) => "outer"; fn run(y) { fn d(x, y: Int) => "inner"; d(1, y) } print(run("s")); now commits to the inner d while analysing run, forcing y to Int and rejecting the String call. Previously, both scopes remained viable until the call supplied String, allowing the outer overload to be selected. Keep this call undecided unless the nonliteral arguments also cannot change which scope accepts it.
Useful? React with 👍 / 👎.
…cope takes it 🎯 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@codex review |
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
A review of the type-checker branch (PR #291) found these, all independent of how
Anyworks (which is being redesigned separately, #331).Bug fixes:
pure fnshared one cache between1and1.0, which are equal, sosame(1.0)returned the cached Int: each set of argument types of apure fnnow gets an instance, and a cache, of its own.Any, so(x - 1, y + 1).map(abs)was rejected while the list form worked. A single-overload call now waits while a sequence argument waits to iterate.fn run2() { fn d(x) => "inner"; let r = d(1); d(2.5); r },d(1)ended up calling an outerfn d(x: Int). When the nearest scope that takes a call has one overload whose parameters take whatever its literals become, the call commits to it.let xs = [0.5, n]could turnninto a Float and0..nfailed as the program ran. The bounds are now Ints, and a Float or Number bound is an analysis error.xs[1..3] = 5..7passed analysis and failed as the program ran: a list slice now takes any sequence, as its signature says.Simplifications (from the review, −84 lines): delete the unused
StaticType::with_element_typeand a slice branch ofvalidate_assignment_writethat could never run, replaceTypeVars::try_settlewithtry_unify, defineheld_literalas the first ofheld_literals, and give a value callee the same checks path as other calls.Analysis of the large benchmark files is 2–3% slower, from the tuple fix's extra check per sequence parameter; the VM is unchanged.
🤖 Generated with Claude Code