Repository navigation
fix(analyser): keep promised types true for pops, maps and Any indexes 🩹 - #316
Merged
Merged
Conversation
…s and Any indexes 🩹 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015rQP9SKVmpvME4F2LXeWmG
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the review findings still open on the type checker PR (#291): places where a type the analyser promised didn't match the value the program gets, so a later call could pick the wrong overload.
Behaviour changes:
popandpop_lefton an empty list are an error, aspopon a deque or heap already is, since their return type promises an element.pop?andpop_left?returnNoneinstead.Anychecks the value:xs[i] = "bad"on aList<Int>is an analysis error, andx["foo"] = 69is one too, where it failed at runtime with "Invalid list index" before. AnAnyindex still picks between the element and the range overload as the program runs.Bug fixes:
%{:"missing", x: x for x in xs}holds Strings as well as Ints.():%{"a", "b": 1}holds()as well as Ints.[]=(List<T>, Any, Any)overload is gone. Calls the program picks the overload of as it runs keep only the overloads that take the arguments with each type parameter one type, as early picks already did, so[]=(List<T>, Int, T)no longer looks like it takes a String for aList<Int>. Operators, which may apply to each element of a tuple, and function arguments, whose types aren't checked as the program runs, are left out of that check.()as cheaply as a scalar, and any iterator conforms to anIterator<T>, since its elements can't be checked without consuming it.🤖 Generated with Claude Code
https://claude.ai/code/session_015rQP9SKVmpvME4F2LXeWmG