Merge #1277 (bot type) prerequisite into #1280 (duck-type own method) - #55
Draft
apiology wants to merge 5 commits into
Draft
Merge #1277 (bot type) prerequisite into #1280 (duck-type own method)#55apiology wants to merge 5 commits into
apiology wants to merge 5 commits into
Conversation
Chain::Call#resolve converted duck-typed receivers to Object and searched Object's real method stack, so a call matching the duck type's own declared method (e.g. `# @PARAM thing [#read_body]` then `thing.read_body`) was reported as unresolved at strict typecheck levels and above, even though ApiMap#get_complex_type_methods already handles this case correctly for completion. Special-case duck-type receivers to synthesize a matching Pin::DuckMethod, mirroring get_complex_type_methods. The pin is marked non-explicit so arity checking (which has no real signature to check against) is skipped. Fixes castwide#1257 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016tARKRqywwAoLhA6DnLCET
The fix in Chain::Call#resolve is level-independent, and alpha is the strictest level, so testing there is a stronger guarantee than strict. Claude-Session: https://claude.ai/code/session_016tARKRqywwAoLhA6DnLCET
…d#typify Pin::DuckMethod.new never sets closure:, so the unconditional closure.gates call crashed with NoMethodError on duck-typed method calls. Use the pin's own gates accessor (already nil-safe) instead. typify_from_super also returned an ancestor pin's raw, unqualified return_type instead of calling pin.typify(api_map) on it, so a borrowed type would be qualified against the duck pin's own fabricated gates rather than the ancestor's real ones. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SPC3E2mM9NLYTC7YY3GnG8
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.
Intra-fork PR to view the incremental diff and CI for PR castwide#1280 (castwide#1280) after merging in PR castwide#1277's prerequisite commit (bot type support, castwide#1277).
Not intended to merge upstream as-is — castwide/solargraph won't accept a base branch that only exists in a fork (see the github-cross-fork-pr-base skill). This exists purely so the incremental diff/CI for the follow-up bot? fix in Call#resolve is reviewable on its own, separate from castwide#1277's own diff.
The real upstream PR (castwide#1280) is untouched, still based on castwide/solargraph:master.