Skip to content

[regression] Fix resolution of ambiguous argument types - #1098

Merged
castwide merged 9 commits into
castwide:masterfrom
apiology:fix_gates_in_arg_types
Dec 30, 2025
Merged

castwide merged 9 commits into
castwide:masterfrom
apiology:fix_gates_in_arg_types

Conversation

@apiology

@apiology apiology commented Sep 25, 2025 •

Copy link
Copy Markdown
Contributor

This is a case where incorrect gates result in the wrong type being used - found by strong typechecking on a branch ::Solargraph::Pin::Symbol was resolved as ::Symbol in a generics scenario.

This is a case where incorrect gates result in the wrong type being
used - found by strong typechecking on a branch ::Solargraph::Pin::Symbol
was resolved as ::Symbol in a generics scenario.
@apiology
apiology marked this pull request as draft September 25, 2025 21:39
@apiology
apiology marked this pull request as ready for review September 26, 2025 13:39
I was hitting a strange 'works on my machine' issue and figured it out
that I wasn't seeing it because of a difference in where files lived
in CI vs my machine.  This resulted in different pin info being
selected during combination, as we were using the file location when
we had no better way to prefer one over the other.

This should make the result more consistent, making user and CI
pin-combination-triggered issues easier to reproduce.
# @param locals [::Array<Solargraph::Pin::LocalVariable, Solargraph::Pin::Parameter>]
# @return [::Array<Pin::Base>]
def inferred_pins pins, api_map, name_pin, locals
result = pins.map do |p|

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

call.rb could use a refactor for sure - we should keep that to a separate PR, though. Adding to rubocop todo file.

@castwide
castwide merged commit 5642e72 into castwide:master Dec 30, 2025
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants